def validate_options_in_mode()

in utilities/Hive_metastore_migration/src/hive_metastore_migration.py [0:0]


def validate_options_in_mode(options, mode, required_options, not_allowed_options):
    for option in required_options:
        if options.get(option) is None:
            raise AssertionError('Option %s is required for mode %s' % (option, mode))
    for option in not_allowed_options:
        if options.get(option) is not None:
            raise AssertionError('Option %s is not allowed for mode %s' % (option, mode))