Skip to content

Commit

Permalink
Fix the priority of the ostreesetup kickstart command (#1896761)
Browse files Browse the repository at this point in the history
Keep the same priorities as in the payload property of the Anaconda class.
If ostreesetup is in the kickstart file, always create the RPM OSTree module.

Resolves: rhbz#1896761
  • Loading branch information
poncovka committed Nov 12, 2020
1 parent df93d40 commit 9c7288d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyanaconda/modules/payloads/payload/factory.py
Expand Up @@ -58,6 +58,9 @@ def get_type_for_kickstart(cls, data):
:param data: a kickstart data
:return: a payload type
"""
if data.ostreesetup.seen:
return PayloadType.RPM_OSTREE

if data.liveimg.seen:
return PayloadType.LIVE_IMAGE

Expand All @@ -69,7 +72,4 @@ def get_type_for_kickstart(cls, data):
data.packages.seen:
return PayloadType.DNF

if data.ostreesetup.seen:
return PayloadType.RPM_OSTREE

return None
12 changes: 12 additions & 0 deletions tests/nosetests/pyanaconda_tests/module_payload_rpm_ostree_test.py
Expand Up @@ -86,3 +86,15 @@ def ostree_kickstart_test(self):
"""
self.shared_ks_tests.check_kickstart(ks_in, ks_out)
self._check_properties(SOURCE_TYPE_RPM_OSTREE)

def priority_kickstart_test(self):
ks_in = """
ostreesetup --osname="fedora-iot" --url="https://compose/iot/" --ref="fedora/iot"
url --url="https://compose/Everything"
"""
ks_out = """
# OSTree setup
ostreesetup --osname="fedora-iot" --remote="fedora-iot" --url="https://compose/iot/" --ref="fedora/iot"
"""
self.shared_ks_tests.check_kickstart(ks_in, ks_out)
self._check_properties(SOURCE_TYPE_RPM_OSTREE)

0 comments on commit 9c7288d

Please sign in to comment.