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 5, 2019
1 parent eed2886 commit e8ba5d2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/jenkins/ardana/gerrit/build_test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import argparse
import contextlib
import glob
from io import StringIO
import os
import re
import shutil
Expand Down Expand Up @@ -194,11 +195,18 @@ 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',
args = ['-A', 'https://api.suse.de', 'deleterequest',
self.obs_test_project_name, '--accept-in-hours', 720,
'-m', 'Auto delete after 30 days.')
'-m', 'Auto delete after 30 days.']
if version.StrictVersion(osc_ver) > version.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 e8ba5d2

Please sign in to comment.