diff --git a/confluent_server/bin/confluentdbutil b/confluent_server/bin/confluentdbutil index e5acb419..cce5a371 100755 --- a/confluent_server/bin/confluentdbutil +++ b/confluent_server/bin/confluentdbutil @@ -51,7 +51,11 @@ if args[0] == 'restore': if pid is not None: print("Confluent is running, must shut down to restore db") sys.exit(1) - cfm.restore_db_from_directory(dumpdir, options.password) + try: + cfm.restore_db_from_directory(dumpdir, options.password) + except Exception as e: + print(str(e)) + sys.exit(1) elif args[0] == 'dump': if options.password is None and not (options.unprotected or options.redact): print("Must indicate a password to protect or -u to opt opt of " diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 1463ac26..0f4a91e0 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -1560,6 +1560,13 @@ class ConfigManager(object): tmpconfig[confarea] = {} for element in dumpdata[confarea]: newelement = copy.deepcopy(dumpdata[confarea][element]) + try: + noderange._parser.parseString( + '({0})'.format(element)).asList() + except noderange.pp.ParseException as pe: + raise ValueError( + '"{0}" is not a supported name, it must be renamed or ' + 'removed from backup to restore'.format(element)) for attribute in dumpdata[confarea][element]: if newelement[attribute] == '*REDACTED*': raise Exception(