Fix convert rpm_ostree config to YAML
Merges: https://pagure.io/pungi/pull-request/1088 Signed-off-by: Mohan Boddu <mboddu@bhujji.com>
This commit is contained in:
parent
07d08627c6
commit
324b371cff
@ -43,7 +43,12 @@ def get_ref_from_treefile(treefile, arch=None, logger=None):
|
|||||||
if os.path.isfile(treefile):
|
if os.path.isfile(treefile):
|
||||||
with open(treefile, 'r') as f:
|
with open(treefile, 'r') as f:
|
||||||
try:
|
try:
|
||||||
parsed = json.loads(f.read())
|
# rpm-ostree now supports YAML
|
||||||
|
# https://github.com/projectatomic/rpm-ostree/pull/1377
|
||||||
|
if treefile.endswith(".yaml"):
|
||||||
|
parsed = yaml.safe_load(f)
|
||||||
|
else:
|
||||||
|
parsed = json.loads(f.read())
|
||||||
if arch is None:
|
if arch is None:
|
||||||
basearch = getBaseArch()
|
basearch = getBaseArch()
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user