mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix JSON loading
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
7650854d12
commit
115ba148b3
1 changed files with 4 additions and 2 deletions
|
@ -764,7 +764,8 @@ def _create_onedir_based_repo(
|
|||
if ret.returncode:
|
||||
repo_json = {}
|
||||
else:
|
||||
repo_json = json.loads(str(repo_json_path))
|
||||
with repo_json_path.open() as rfh:
|
||||
repo_json = json.load(rfh)
|
||||
|
||||
if salt_version not in repo_json:
|
||||
repo_json[salt_version] = {}
|
||||
|
@ -852,7 +853,8 @@ def _create_onedir_based_repo(
|
|||
if ret.returncode:
|
||||
minor_repo_json = {}
|
||||
else:
|
||||
minor_repo_json = json.loads(str(minor_repo_json_path))
|
||||
with minor_repo_json_path.open() as rfh:
|
||||
minor_repo_json = json.load(rfh)
|
||||
|
||||
minor_repo_json[salt_version] = repo_json[salt_version]
|
||||
minor_repo_json_path.write_text(json.dumps(minor_repo_json))
|
||||
|
|
Loading…
Add table
Reference in a new issue