This is an automated email from the git hooks/post-receive script.
clime pushed a commit to branch master
in repository copr/copr.
commit 22f0c0f38f3b2dfa54bda8e51d83db7d7c0628a8
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Oct 12 11:33:13 2016 +0200
[dist-git] run mock-scm inside of docker
---
dist-git/dist_git/dist_git_importer.py | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/dist-git/dist_git/dist_git_importer.py
b/dist-git/dist_git/dist_git_importer.py
index e7782f9..1196ce5 100755
--- a/dist-git/dist_git/dist_git_importer.py
+++ b/dist-git/dist_git/dist_git_importer.py
@@ -325,14 +325,7 @@ class MockScmProvider(SrpmBuilderProvider):
"--buildsrpm",
"--resultdir={}".format(self.tmp_dest)]
log.debug(' '.join(cmd))
- try:
- proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
- output, error = proc.communicate()
- except OSError as e:
- raise SrpmBuilderException(str(e))
- if proc.returncode != 0:
- raise SrpmBuilderException(error)
-
+ VM.run(cmd, dst_dir=self.tmp_dest, cwd=self.tmp_dest, name=self.task.task_id,
sys_admin=True)
self.copy()
def scm_option_get(self, package_name, branch):
@@ -680,11 +673,12 @@ class VM(object):
hash = None
@staticmethod
- def run(cmd, dst_dir, src_dir=None, cwd="/", name=None, clean=True):
+ def run(cmd, dst_dir, src_dir=None, cwd="/", name=None, clean=True,
sys_admin=False):
"""
Run command in Virtual Machine (Docker)
:param cmd: list
:param clean: bool whether to remove docker container
+ :param sys_admin: bool When se to True then container is run with SYS_ADMIN
capability
:return: tuple output, error
"""
def sandbox(path):
@@ -696,6 +690,8 @@ class VM(object):
dcmd = ["docker", "run"]
full_name = "-".join([name or "copr",
hashlib.md5().hexdigest()])
+ if sys_admin:
+ dcmd.extend(["--cap-add=SYS_ADMIN"])
dcmd.extend(["--name", full_name])
dcmd.extend(["-v", "{}:{}".format(dst_dir, dst_dir)])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date