#1088 Fix convert rpm_ostree config to YAML
Merged 7 months ago by lsedlar. Opened 7 months ago by mohanboddu.

file modified
+5 -1

@@ -43,7 +43,11 @@ 

      if os.path.isfile(treefile):

          with open(treefile, 'r') as f:


-                 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:

                      basearch = getBaseArch()


what prompted this change? did something break?

Yes, signing ostrees is broken in rawhide:

[15:11:34] <puiterwijk> adamw, nirik, mboddu: so, the part responsible for break rawhide: dustymabe's change to silverlbue.yaml: https://pagure.io/pungi-fedora/c/1a64d409e9fef6f71dc5c3ce57dbfb92c7f2b052?branch=master
[15:12:26] <puiterwijk> The problem: when Colin made Pungi able to read yaml-formatted ostree definitions, he did not modify https://pagure.io/pungi/blob/master/f/pungi/ostree/utils.py#_36 which is used to get the reference to send fedmsg's, which is what robosignatory depends on
[15:13:49] <puiterwijk> (original patch to pungi: https://pagure.io/pungi/pull-request/1019#request_diff)

Hopefully this fixes it. I guess we need a patched pungi...

The code looks reasonable.

This change definitely makes sense no matter if it fixes the signing or not.

Commit 324b371 fixes this pull-request

Pull-Request has been merged by lsedlar

7 months ago

Thanks @kevin, for the explanation! I appreciate it. At least we found this in rawhide and didn't break a release stream

I think what we should do after the next rpm-ostree release is follow https://github.com/coreos/coreos-assembler/pull/192 - this way rpm-ostree does all the heavy lifting in parsing and consumers only see JSON.