1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-03-01 13:42:12 +01:00

Store apiurl in Project and Package instances

This commit is contained in:
Daniel Mach 2024-02-29 09:51:46 +01:00
parent cd95478ac8
commit 772509c023
2 changed files with 5 additions and 5 deletions

View File

@ -75,7 +75,7 @@ class Package(XmlModel):
"rev": rev,
}
response = cls.xml_request("GET", apiurl, url_path, url_query)
return cls.from_file(response)
return cls.from_file(response, apiurl=apiurl)
def to_api(self, apiurl, *, project=None, package=None):
project = project or self.project
@ -83,7 +83,7 @@ class Package(XmlModel):
url_path = ["source", project, package, "_meta"]
url_query = {}
response = self.xml_request("PUT", apiurl, url_path, url_query, data=self.to_string())
return Status.from_file(response)
return Status.from_file(response, apiurl=apiurl)
@classmethod
def cmd_release(
@ -125,4 +125,4 @@ class Package(XmlModel):
"nodelay": nodelay,
}
response = cls.xml_request("POST", apiurl, url_path, url_query)
return Status.from_string(response.read())
return Status.from_file(response, apiurl=apiurl)

View File

@ -112,14 +112,14 @@ class Project(XmlModel):
url_path = ["source", project, "_meta"]
url_query = {}
response = cls.xml_request("GET", apiurl, url_path, url_query)
return cls.from_file(response)
return cls.from_file(response, apiurl=apiurl)
def to_api(self, apiurl, *, project=None):
project = project or self.name
url_path = ["source", project, "_meta"]
url_query = {}
response = self.xml_request("PUT", apiurl, url_path, url_query, data=self.to_string())
return Status.from_file(response)
return Status.from_file(response, apiurl=apiurl)
def resolve_repository_flags(self, package_obj=None):
"""