return -errno.EINVAL, '', 'Value should not be empty or None'
self.log.debug('Setting configuration option %s to %s', key, value)
- self.set_config_option(key, value)
- self.set_module_option(key, value)
- return 0, 'Configuration option {0} updated'.format(key), ''
+ try:
+ self.set_module_option(key, value)
+ self.set_config_option(key, value)
+ return 0, 'Configuration option {0} updated'.format(key), ''
+ except ValueError as e:
+ return -errno.EINVAL, '', str(e)
elif cmd['prefix'] == 'influx send':
self.send_to_influx()
return 0, 'Sending data to Influx', ''