1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 16:56:15 +01:00

- yet another fix for old OBS instances

This commit is contained in:
Adrian Schröter 2011-08-23 16:03:58 +02:00
parent c140a1d975
commit cdc21c6011

View File

@ -211,6 +211,8 @@ class Serviceinfo:
def __init__(self):
"""creates an empty serviceinfo instance"""
self.services = None
self.project = None
self.package = None
def read(self, serviceinfo_node, append=False):
"""read in the source services <services> element passed as
@ -246,11 +248,11 @@ class Serviceinfo:
f = http_POST(u)
root = ET.parse(f).getroot()
self.read(root, True)
self.project = project
self.package = package
except urllib2.HTTPError, e:
if e.code != 403:
if e.code != 403 and e.code != 400:
raise e
self.project = project
self.package = package
def addVerifyFile(self, serviceinfo_node, filename):
import hashlib
@ -315,9 +317,10 @@ class Serviceinfo:
data = { 'name' : singleservice, 'command' : singleservice, 'mode' : '' }
allservices = [data]
# set environment
os.putenv("OBS_SERVICE_PROJECT", self.project)
os.putenv("OBS_SERVICE_PACKAGE", self.package)
# set environment when using OBS 2.3 or later
if self.project != None:
os.putenv("OBS_SERVICE_PROJECT", self.project)
os.putenv("OBS_SERVICE_PACKAGE", self.package)
# recreate files
ret = 0