Commit 3bcbabca authored by Roman Alifanov's avatar Roman Alifanov

use literal_eval in get output

parent 980784af
......@@ -84,7 +84,12 @@ class CustomSetting(BaseSetting):
try:
cmd = self._format_command(self.get_command)
output = self._execute_command(cmd)
return output
try: value = ast.literal_eval(output)
except Exception as e:
value = output
self.logger.info(f"GET: {output} with error {e}")
return value
except subprocess.CalledProcessError as e:
self.logger.error(f"Get command failed: {e.stderr}")
return self.default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment