def main(): args = parse_commandline_args() connection = utils.open_connection(args) config = {"ID": args.new} utils.write_command_retry( connection, commands.encode_update_config(config), [args.old] ) utils.write_command_retry(connection, commands.encode_save_config(), [args.new])
def config_update_and_save(fdesc, config, destinations): """ Updates the config of the given destinations. Keys not in the given config are left unchanged. """ # First send the updated config command = commands.encode_update_config(config) write_command_retry(fdesc, command, destinations) # Then save the config to flash write_command_retry(fdesc, commands.encode_save_config(), destinations)
def main(): args = parse_commandline_args() connection = utils.open_connection(args) config = {"ID": args.new} utils.write_command_retry(connection, commands.encode_update_config(config), [args.old]) utils.write_command_retry(connection, commands.encode_save_config(), [args.new])