Skip to content

Commit

Permalink
Allow pulp-only repos when requesting ODCS composes (OSBS-5462)
Browse files Browse the repository at this point in the history
In the case where no packages are requested, no modules are requested,
but pulp_repos is true *and* there are Pulp content sets defined, do the
right thing.

Do not reject the build. Do not request package or module composes.
Request the Pulp composes.

Signed-off-by: Tim Waugh <twaugh@redhat.com>
  • Loading branch information
twaugh authored and rcerven committed Apr 16, 2018
1 parent 827f401 commit 7004cd9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions atomic_reactor/plugins/pre_resolve_composes.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def render_requests(self):
requests = []
if self.packages:
requests.append(self.render_packages_request())
else:
elif self.modules:
requests.append(self.render_modules_request())

for arch in self.pulp:
Expand Down Expand Up @@ -382,8 +382,8 @@ def render_pulp_request(self, arch):

def validate_for_request(self):
"""Verify enough information is available for requesting compose."""
if not self.packages and not self.modules:
raise ValueError('List of packages or modules cannot be empty')
if not self.packages and not self.modules and not self.pulp:
raise ValueError("Nothing to compose (no packages, modules, or enabled pulp repos)")

if self.packages and self.modules:
raise ValueError('Compose config cannot contain both packages and modules')
Expand Down
9 changes: 7 additions & 2 deletions tests/plugins/test_resolve_composes.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,17 @@ def test_signing_intent_multiple_composes(self, workflow, composes_intent, expec
(dedent("""\
compose:
packages: []
"""), 'cannot be empty'),
"""), 'Nothing to compose'),
(dedent("""\
compose:
modules: []
"""), 'cannot be empty'),
"""), 'Nothing to compose'),
(dedent("""\
compose:
pulp_repos: true
"""), 'Nothing to compose'),
(dedent("""\
compose:
Expand Down

0 comments on commit 7004cd9

Please sign in to comment.