Skip to content

Commit

Permalink
Fix build_test_package.py osc syntax
Browse files Browse the repository at this point in the history
As of osc version 0.164.2 the --all option must be supplied on
deleterequest operations. This changes allow build_test_package.py
to work on systems with newer versions of open build service commander.
  • Loading branch information
Ryan Tidwell committed Jun 6, 2019
1 parent eed2886 commit d58ae4e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/jenkins/ardana/gerrit/build_test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
This file takes in a list of gerrit changes to build into the supplied OBS
project.
"""

import argparse
import contextlib
import glob
Expand All @@ -16,6 +15,9 @@
import time
import urllib

from distutils.version import StrictVersion
from io import StringIO

import sh

try:
Expand Down Expand Up @@ -194,11 +196,17 @@ def _create_test_project(self):
meta.flush()
print("Creating test project %s linked to project %s" %
(self.obs_test_project_name, self.obs_linked_project))
buf = StringIO()
sh.osc('--version', _out=buf)
osc_ver = buf.getvalue()
sh.osc('-A', 'https://api.suse.de', 'api', '-T', meta.name,
'/source/%s/_meta' % self.obs_test_project_name)
sh.osc('-A', 'https://api.suse.de', 'deleterequest',
self.obs_test_project_name, '--accept-in-hours', 720,
'-m', 'Auto delete after 30 days.')
args = ['-A', 'https://api.suse.de', 'deleterequest',
self.obs_test_project_name, '--accept-in-hours', 720,
'-m', 'Auto delete after 30 days.']
if StrictVersion(osc_ver) > StrictVersion('0.164.1'):
args.append('--all')
sh.osc(*args)

@find_in_osc_file('obs_scm filename')
def _get_obsinfo_basename(self, service_def):
Expand Down

0 comments on commit d58ae4e

Please sign in to comment.