Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build_test_package.py osc syntax #3473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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