Commit 2d0ab2f5 authored by Robert Spencer's avatar Robert Spencer
Browse files

Remove ast and load using JSON loader



We can use the JSON loader to suck in the backup_lvs array from the
configuration INI file, so we do so.
Signed-off-by: Robert Spencer's avatarRobert Spencer <rspencer@lbsd.net>
parent 2567510c
...@@ -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