mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
Put name, stream and version into the modulemd file
This commit is contained in:
@@ -125,9 +125,7 @@ class CoprModuleBuilder(GenericBuilder):
|
||||
def _create_module_safe(self):
|
||||
from copr.exceptions import CoprRequestException
|
||||
|
||||
modulemd = tempfile.mktemp()
|
||||
self.module.mmd().dump(modulemd)
|
||||
|
||||
modulemd = self._dump_mmd()
|
||||
kwargs = {
|
||||
"username": self.module.copr_owner or self.owner,
|
||||
"projectname": self.module.copr_project or
|
||||
@@ -144,6 +142,18 @@ class CoprModuleBuilder(GenericBuilder):
|
||||
finally:
|
||||
os.remove(modulemd)
|
||||
|
||||
def _dump_mmd(self):
|
||||
# Write module's name, stream and version into the modulemd file
|
||||
# so Copr can parse it from there
|
||||
mmd = self.module.mmd()
|
||||
mmd.name = str(self.module.name)
|
||||
mmd.stream = str(self.module.stream)
|
||||
mmd.version = int(self.module.version)
|
||||
|
||||
modulemd = tempfile.mktemp()
|
||||
mmd.dump(modulemd)
|
||||
return modulemd
|
||||
|
||||
def buildroot_ready(self, artifacts=None):
|
||||
"""
|
||||
:param artifacts=None : a list of artifacts supposed to be in the buildroot
|
||||
@@ -295,8 +305,7 @@ class CoprModuleBuilder(GenericBuilder):
|
||||
chroots=[self.chroot])
|
||||
|
||||
def finalize(self):
|
||||
modulemd = tempfile.mktemp()
|
||||
self.module.mmd().dump(modulemd)
|
||||
modulemd = self._dump_mmd()
|
||||
|
||||
# Create a module from previous project
|
||||
result = self.client.make_module(username=self.copr.username,
|
||||
|
||||
Reference in New Issue
Block a user