As part of a FAH release we go through each architecture to make sure that the qcow that was created has the same ostree version # across them all. This is to prevent us from doing a release with artifacts that have mismatched ostree versions. It would be nice for us to automate this discovery so we don't have to do it by hand.
Some options are:
Just leaving this guestfish one-liner I came up with for future reference (both mine and whoever tackles this ticket):
guestfish
$ guestfish -- add Fedora-Atomic-27-20171101.0.x86_64.qcow2 : run : -mount /dev/atomicos/root / : cat /ostree/deploy/fedora-atomic/deploy/908188b741a44050cf4ec56ef63cbf6e1c8f0efc489195095d4d959f136eda8e.0/usr/lib/os.release.d/os-release-fedora | grep OSTREE_VERSION
Python method version I'm testing:
def get_ostree_version(self): try: g = guestfs.GuestFS(python_return_dict=True) g.add_drive_opts(self._image_path, format="qcow2", readonly=0) g.launch() g.mount('/dev/atomicos/root', '/') dir = g.ls('/ostree/deploy/fedora-atomic/deploy/')[0] data = g.cat( '/ostree/deploy/fedora-atomic/deploy/' '{}/usr/lib/os.release.d/os-release-fedora'.format(dir)) version = re.findall("OSTREE_VERSION=(.*)", data)[0] g.shutdown() return version except Exception as ex: raise Exception( 'Unable to read ostree version: {}: {}'.format(type(ex), ex))
Class: https://github.com/ashcrow/release-dashboard/blob/master/src/release_dashboard/checks/ostree_version.py
Metadata Update from @dustymabe: - Issue tagged with: host
Login to comment on this ticket.