Commit 2fe28c8f authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'remove-ast' into 'master'

Remove ast and load using JSON loader

See merge request !49
parents 2567510c 2d0ab2f5
Pipeline #6660 passed with stages
in 42 seconds
...@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
""" """
import argparse import argparse
import ast
import configparser import configparser
from datetime import datetime from datetime import datetime
import json import json
...@@ -68,7 +67,7 @@ else: ...@@ -68,7 +67,7 @@ else:
if os.path.exists(JSON_FILE): if os.path.exists(JSON_FILE):
with open(JSON_FILE, encoding="utf8") as json_file: with open(JSON_FILE, encoding="utf8") as json_file:
json_dict = json.load(json_file) json_dict = json.loads(json_file)
PERIOD = json_dict["period"] PERIOD = json_dict["period"]
lv_list = json_dict["lv_list"] lv_list = json_dict["lv_list"]
...@@ -149,7 +148,7 @@ else: ...@@ -149,7 +148,7 @@ else:
syncopts.append("--bwlimit=" + str(bwlimit)) syncopts.append("--bwlimit=" + str(bwlimit))
if not lv_list: if not lv_list:
lv_list = ast.literal_eval(config.get(PERIOD, "backup_lvs")) lv_list = json.loads(config.get(PERIOD, "backup_lvs"))
stack_dict = {} stack_dict = {}
......
Supports Markdown
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