[copr] master: Automatic commit of package [copr] release [1.10-1]. (8144240)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8144240a0faa82f184531f26f91e9caabedb8aec
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Oct 25 11:53:38 2013 +0200
Automatic commit of package [copr] release [1.10-1].
>---------------------------------------------------------------
copr.spec | 33 ++++++++++++++++++++++++++++++++-
rel-eng/packages/copr | 2 +-
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/copr.spec b/copr.spec
index 5fb96e0..b5f0797 100644
--- a/copr.spec
+++ b/copr.spec
@@ -5,7 +5,7 @@
%global modulename copr
Name: copr
-Version: 1.9
+Version: 1.10
Release: 1%{?dist}
Summary: Cool Other Package Repo
@@ -380,6 +380,37 @@ fi
%{_mandir}/man8/%{name}-selinux-relabel.8*
%changelog
+* Fri Oct 25 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.10-1
+- do not normalize url
+- specify full prefix of http
+- execute playbook using /usr/bin/ansible-playbook
+- use ssh transport
+- check after connection is made
+- add notes about debuging mockremote
+- clean up instance even when worker fails
+- normalize paths before using
+- do not use exception variable
+- operator should be preceded and followed by space
+- remove trailing whitespace
+- convert comment to docstring
+- use ssh transport
+- do not create new ansible connection, reuse self.conn
+- run copr-be.py as copr
+- s/Copr/Project/ where we use copr in meaning of projects
+- number will link to those coprs, to which it refers
+- run log and jobgrab as copr user
+- log event to log file
+- convert comment into docstring
+- use unbufferred output for copr-be.py
+- hint how to set ec2 variables
+- document sleeptime
+- document copr_url for copr-cli
+- document how to set api key for copr-cli
+- do not create list of list
+- document SECRET_KEY variable
+- make note how to become admin
+- instruct people to install selinux with frontend
+
* Thu Oct 03 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.9-1
- prune old builds
- require python-decorator
diff --git a/rel-eng/packages/copr b/rel-eng/packages/copr
index 0685ba1..412af9b 100644
--- a/rel-eng/packages/copr
+++ b/rel-eng/packages/copr
@@ -1 +1 @@
-1.9-1 ./
+1.10-1 ./
10 years, 6 months
[copr] master: do not normalize url (66b73b4)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 66b73b436cbb0018e301d11b2f93f91060b0d1e2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Oct 24 16:08:38 2013 +0200
do not normalize url
result is url in form http:// which normmath reduce to http:/ which we do not want
>---------------------------------------------------------------
backend/dispatcher.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 83c837a..c23d02d 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -350,7 +350,7 @@ class Worker(multiprocessing.Process):
self.callback.log('building pkgs: %s' % ' '.join(job.pkgs))
try:
chroot_repos = list(job.repos)
- chroot_repos.append(os.path.normpath(job.results + '/' + chroot))
+ chroot_repos.append(job.results + '/' + chroot)
chrootlogfile = chroot_destdir + '/build-%s.log' % job.build_id
mr = mockremote.MockRemote(builder=ip, timeout=job.timeout,
destdir=job.destdir, chroot=chroot, cont=True, recurse=True,
10 years, 6 months
[copr] master: specify full prefix of http (8b31fbc)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8b31fbc7d979b75c03ecb2eeb15254d41102246f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Oct 24 15:29:45 2013 +0200
specify full prefix of http
because if we pass just http:/
mock will fail with
Traceback (most recent call last):
File "/usr/bin/mockchain", line 336, in <module>
main(sys.argv)
File "/usr/bin/mockchain", line 235, in main
res, msg = add_local_repo(my_mock_config, my_mock_config, baseurl)
File "/usr/bin/mockchain", line 95, in add_local_repo
repoid=baseurl.split('//')[1].replace('/','_')
IndexError: list index out of range
>---------------------------------------------------------------
backend/mockremote.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/backend/mockremote.py b/backend/mockremote.py
index c60291b..75d7d2c 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -585,7 +585,7 @@ def parse_args(args):
sys.exit(1)
for url in opts.repos:
- if not (url.startswith('http') or url.startswith('file://')):
+ if not (url.startswith('http://') or url.startswith('https://') or url.startswith('file://')):
print "Only http[s] or file urls allowed for repos"
sys.exit(1)
10 years, 6 months
[copr] master: execute playbook using /usr/bin/ansible-playbook (825f1eb)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 825f1ebd21c4b9f2ced7ac6e0c3241237c313d2c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Oct 24 10:28:20 2013 +0200
execute playbook using /usr/bin/ansible-playbook
I am giving up. Something is broken and I do not know what
https://groups.google.com/forum/#!topic/ansible-project/DNBD2oHv5k8
If somebody ever find the cause, feel free to revert this commit
>---------------------------------------------------------------
backend/dispatcher.py | 70 ++++++++++++++++++++++++++++--------------------
1 files changed, 41 insertions(+), 29 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 5f0cb17..83c837a 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -12,6 +12,9 @@ import ansible.playbook
import ansible.errors
from ansible import callbacks
import requests
+import subprocess
+import string
+from IPy import IP
try:
import fedmsg
@@ -144,47 +147,56 @@ class Worker(multiprocessing.Process):
self.callback.log('spawning instance begin')
start = time.time()
- stats = callbacks.AggregateStats()
- playbook_cb = SilentPlaybookCallbacks(verbose=False)
- runner_cb = callbacks.DefaultRunnerCallbacks()
- # fixme - extra_vars to include ip as a var if we need to specify ips
- # also to include info for instance type to handle the memory requirements of builds
- play = ansible.playbook.PlayBook(stats=stats, playbook=self.opts.spawn_playbook,
- callbacks=playbook_cb, runner_callbacks=runner_cb,
- remote_user='root', transport='ssh')
+ #Does not work, do not know why. See:
+ #https://groups.google.com/forum/#!topic/ansible-project/DNBD2oHv5k8
+ #stats = callbacks.AggregateStats()
+ #playbook_cb = SilentPlaybookCallbacks(verbose=False)
+ #runner_cb = callbacks.DefaultRunnerCallbacks()
+ ## fixme - extra_vars to include ip as a var if we need to specify ips
+ ## also to include info for instance type to handle the memory requirements of builds
+ #play = ansible.playbook.PlayBook(stats=stats, playbook=self.opts.spawn_playbook,
+ # callbacks=playbook_cb, runner_callbacks=runner_cb,
+ # remote_user='root', transport='ssh')
+ #play.run()
+ result = subprocess.check_output("ansible-playbook -c ssh %s" % self.opts.spawn_playbook,
+ shell=True)
+ self.callback.log('Raw output from playbook: %s' % result)
+ # 4rd line from end, first column
+ result = string.strip((result.split('\n'))[-4].split(' ')[0])
- play.run()
self.callback.log('spawning instance end')
self.callback.log('Instance spawn/provision took %s sec' % (time.time() - start))
if self.ip:
return self.ip
- for i in play.SETUP_CACHE:
- if i =='localhost':
- continue
- return i
-
- # if we get here we're in trouble
- self.callback.log('No IP back from spawn_instance - dumping cache output')
- self.callback.log(str(play.SETUP_CACHE))
- self.callback.log(str(play.stats.summarize('localhost')))
- self.callback.log('Test spawn_instance playbook manually')
-
- return None
+ #for i in play.SETUP_CACHE:
+ # if i =='localhost':
+ # continue
+ # return i
+ try:
+ IP(result)
+ return result
+ except ValueError:
+ # if we get here we're in trouble
+ self.callback.log('No IP back from spawn_instance - dumping cache output')
+ self.callback.log(str(play.SETUP_CACHE))
+ self.callback.log(str(play.stats.summarize('localhost')))
+ self.callback.log('Test spawn_instance playbook manually')
+ return None
def terminate_instance(self,ip):
"""call the terminate playbook to destroy the building instance"""
self.callback.log('terminate instance begin')
- stats = callbacks.AggregateStats()
- playbook_cb = SilentPlaybookCallbacks(verbose=False)
- runner_cb = callbacks.DefaultRunnerCallbacks()
- play = ansible.playbook.PlayBook(host_list=ip +',', stats=stats, playbook=self.opts.terminate_playbook,
- callbacks=playbook_cb, runner_callbacks=runner_cb,
- remote_user='root', transport='ssh')
-
- play.run()
+ #stats = callbacks.AggregateStats()
+ #playbook_cb = SilentPlaybookCallbacks(verbose=False)
+ #runner_cb = callbacks.DefaultRunnerCallbacks()
+ #play = ansible.playbook.PlayBook(host_list=ip +',', stats=stats, playbook=self.opts.terminate_playbook,
+ # callbacks=playbook_cb, runner_callbacks=runner_cb,
+ # remote_user='root', transport='ssh')
+ #play.run()
+ subprocess.check_output("/usr/bin/ansible-playbook -c ssh -i '%s,' %s " % (ip, self.opts.terminate_playbook), shell=True)
self.callback.log('terminate instance end')
def parse_job(self, jobfile):
10 years, 6 months
[copr] master: use ssh transport (c20c52c)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c20c52c031b035b88e52ce26c0d6e8f074fc685b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Oct 22 12:13:27 2013 +0200
use ssh transport
leftover after 4f863bd
>---------------------------------------------------------------
backend/dispatcher.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index fc20a74..5f0cb17 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -151,7 +151,7 @@ class Worker(multiprocessing.Process):
# also to include info for instance type to handle the memory requirements of builds
play = ansible.playbook.PlayBook(stats=stats, playbook=self.opts.spawn_playbook,
callbacks=playbook_cb, runner_callbacks=runner_cb,
- remote_user='root')
+ remote_user='root', transport='ssh')
play.run()
self.callback.log('spawning instance end')
@@ -182,7 +182,7 @@ class Worker(multiprocessing.Process):
runner_cb = callbacks.DefaultRunnerCallbacks()
play = ansible.playbook.PlayBook(host_list=ip +',', stats=stats, playbook=self.opts.terminate_playbook,
callbacks=playbook_cb, runner_callbacks=runner_cb,
- remote_user='root')
+ remote_user='root', transport='ssh')
play.run()
self.callback.log('terminate instance end')
10 years, 6 months
[copr] master: check after connection is made (c308cda)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c308cda573e0860d04bbe8e135bcd86b794acf24
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Oct 22 10:16:25 2013 +0200
check after connection is made
we need self.conn in check(), and that is created in _create_ans_conn()
addressing:
ERROR: <type 'exceptions.AttributeError'> - 'Builder' object has no attribute 'conn'
Traceback (most recent call last):
File "backend/mockremote.py", line 643, in <module>
main(sys.argv[1:])
File "backend/mockremote.py", line 616, in main
callback=callback)
File "backend/mockremote.py", line 419, in __init__
self.builder = Builder(builder, user, timeout, self)
File "backend/mockremote.py", line 225, in __init__
self.check()
File "backend/mockremote.py", line 369, in check
self.conn.module_name = "shell"
AttributeError: 'Builder' object has no attribute 'conn'
>---------------------------------------------------------------
backend/mockremote.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 07acc5b..c60291b 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -219,10 +219,10 @@ class Builder(object):
self.mockremote = mockremote
self.checked = False
self._tempdir = None
- # check out the host - make sure it can build/be contacted/etc
- self.check()
# if we're at this point we've connected and done stuff on the host
self.conn = _create_ans_conn(self.hostname, self.username, self.timeout)
+ # check out the host - make sure it can build/be contacted/etc
+ self.check()
@property
def remote_build_dir(self):
10 years, 6 months
[copr] master: add notes about debuging mockremote (6091f6c)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6091f6c9dae74c2d4c711b1ff1b986e041e74346
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Oct 22 09:51:48 2013 +0200
add notes about debuging mockremote
>---------------------------------------------------------------
copr-setup.txt | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/copr-setup.txt b/copr-setup.txt
index 1286d2c..003369c 100644
--- a/copr-setup.txt
+++ b/copr-setup.txt
@@ -134,3 +134,13 @@ Run:
Then navigate to:
http://your.copr.fqdn/admin
+
+
+DEBUGING
+========
+
+Run mockremote as standalone process:
+su - copr
+cd /usr/share/copr
+python backend/mockremote.py -b 172.16.3.4 -r fedora-19-x86_64 <url of src.rpm>
+
10 years, 6 months
[copr] master: clean up instance even when worker fails (a3bf3fb)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit a3bf3fb1c23d810b3dfb64215e05ff2d06004abc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Oct 17 14:56:54 2013 +0200
clean up instance even when worker fails
wrap the block in try/finally and always call terminate_instance
>---------------------------------------------------------------
backend/dispatcher.py | 150 +++++++++++++++++++++++++------------------------
1 files changed, 76 insertions(+), 74 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index c019ac9..fc20a74 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -291,80 +291,82 @@ class Worker(multiprocessing.Process):
self.callback.log('failure to setup instance: %s' % e)
raise
- # This assumes there are certs and a fedmsg config on disk
try:
- if self.opts.fedmsg_enabled:
- fedmsg.init(name="relay_inbound", cert_prefix="copr", active=True)
- except Exception, e:
- self.callback.log('failed to initialize fedmsg: %s' % e)
-
- status = 1
- job.started_on = time.time()
- self.mark_started(job)
-
- template = 'build start: user:{user} copr:{copr} build:{build} ip:{ip} pid:{pid}'
- content = dict(user=job.user_name, copr=job.copr_name,
- build=job.build_id, ip=ip, pid=self.pid)
- self.event('build.start', template, content)
-
- for chroot in job.chroots:
- template = 'chroot start: chroot:{chroot} user:{user} copr:{copr} build:{build} ip:{ip} pid:{pid}'
- content = dict(chroot=chroot, user=job.user_name,
- copr=job.copr_name, build=job.build_id,
- ip=ip, pid=self.pid)
- self.event('chroot.start', template, content)
-
- chroot_destdir = os.path.normpath(job.destdir + '/' + chroot)
- # setup our target dir locally
- if not os.path.exists(chroot_destdir):
- try:
- os.makedirs(chroot_destdir)
- except (OSError, IOError), e:
- msg = "Could not make results dir for job: %s - %s" % (chroot_destdir, str(e))
- self.callback.log(msg)
- status = 0
- continue
-
- # FIXME
- # need a plugin hook or some mechanism to check random
- # info about the pkgs
- # this should use ansible to download the pkg on the remote system
- # and run a series of checks on the package before we
- # start the build - most importantly license checks.
-
-
- self.callback.log('Starting build: id=%r builder=%r timeout=%r destdir=%r chroot=%r repos=%r' % (job.build_id,ip, job.timeout, job.destdir, chroot, str(job.repos)))
- self.callback.log('building pkgs: %s' % ' '.join(job.pkgs))
+ # This assumes there are certs and a fedmsg config on disk
try:
- chroot_repos = list(job.repos)
- chroot_repos.append(os.path.normpath(job.results + '/' + chroot))
- chrootlogfile = chroot_destdir + '/build-%s.log' % job.build_id
- mr = mockremote.MockRemote(builder=ip, timeout=job.timeout,
- destdir=job.destdir, chroot=chroot, cont=True, recurse=True,
- repos=chroot_repos,
- callback=mockremote.CliLogCallBack(quiet=True,logfn=chrootlogfile))
- mr.build_pkgs(job.pkgs)
- except mockremote.MockRemoteError, e:
- # record and break
- self.callback.log('%s - %s' % (ip, e))
- status = 0 # failure
- else:
- # we can't really trace back if we just fail normally
- # check if any pkgs didn't build
- if mr.failed:
- status = 0
- self.callback.log('Finished build: id=%r builder=%r timeout=%r destdir=%r chroot=%r repos=%r' % (job.build_id, ip, job.timeout, job.destdir, chroot, str(job.repos)))
- job.ended_on = time.time()
-
- job.status = status
- self.return_results(job)
- self.callback.log('worker finished build: %s' % ip)
- template = 'build end: user:{user} copr:{copr} build:{build} ip:{ip} pid:{pid} status:{status}'
- content = dict(user=job.user_name, copr=job.copr_name,
- build=job.build_id, ip=ip, pid=self.pid,
- status=job.status)
- self.event('build.end', template, content)
- # clean up the instance
- if self.create:
- self.terminate_instance(ip)
+ if self.opts.fedmsg_enabled:
+ fedmsg.init(name="relay_inbound", cert_prefix="copr", active=True)
+ except Exception, e:
+ self.callback.log('failed to initialize fedmsg: %s' % e)
+
+ status = 1
+ job.started_on = time.time()
+ self.mark_started(job)
+
+ template = 'build start: user:{user} copr:{copr} build:{build} ip:{ip} pid:{pid}'
+ content = dict(user=job.user_name, copr=job.copr_name,
+ build=job.build_id, ip=ip, pid=self.pid)
+ self.event('build.start', template, content)
+
+ for chroot in job.chroots:
+ template = 'chroot start: chroot:{chroot} user:{user} copr:{copr} build:{build} ip:{ip} pid:{pid}'
+ content = dict(chroot=chroot, user=job.user_name,
+ copr=job.copr_name, build=job.build_id,
+ ip=ip, pid=self.pid)
+ self.event('chroot.start', template, content)
+
+ chroot_destdir = os.path.normpath(job.destdir + '/' + chroot)
+ # setup our target dir locally
+ if not os.path.exists(chroot_destdir):
+ try:
+ os.makedirs(chroot_destdir)
+ except (OSError, IOError), e:
+ msg = "Could not make results dir for job: %s - %s" % (chroot_destdir, str(e))
+ self.callback.log(msg)
+ status = 0
+ continue
+
+ # FIXME
+ # need a plugin hook or some mechanism to check random
+ # info about the pkgs
+ # this should use ansible to download the pkg on the remote system
+ # and run a series of checks on the package before we
+ # start the build - most importantly license checks.
+
+
+ self.callback.log('Starting build: id=%r builder=%r timeout=%r destdir=%r chroot=%r repos=%r' % (job.build_id,ip, job.timeout, job.destdir, chroot, str(job.repos)))
+ self.callback.log('building pkgs: %s' % ' '.join(job.pkgs))
+ try:
+ chroot_repos = list(job.repos)
+ chroot_repos.append(os.path.normpath(job.results + '/' + chroot))
+ chrootlogfile = chroot_destdir + '/build-%s.log' % job.build_id
+ mr = mockremote.MockRemote(builder=ip, timeout=job.timeout,
+ destdir=job.destdir, chroot=chroot, cont=True, recurse=True,
+ repos=chroot_repos,
+ callback=mockremote.CliLogCallBack(quiet=True,logfn=chrootlogfile))
+ mr.build_pkgs(job.pkgs)
+ except mockremote.MockRemoteError, e:
+ # record and break
+ self.callback.log('%s - %s' % (ip, e))
+ status = 0 # failure
+ else:
+ # we can't really trace back if we just fail normally
+ # check if any pkgs didn't build
+ if mr.failed:
+ status = 0
+ self.callback.log('Finished build: id=%r builder=%r timeout=%r destdir=%r chroot=%r repos=%r' % (job.build_id, ip, job.timeout, job.destdir, chroot, str(job.repos)))
+ job.ended_on = time.time()
+
+ job.status = status
+ self.return_results(job)
+ self.callback.log('worker finished build: %s' % ip)
+ template = 'build end: user:{user} copr:{copr} build:{build} ip:{ip} pid:{pid} status:{status}'
+ content = dict(user=job.user_name, copr=job.copr_name,
+ build=job.build_id, ip=ip, pid=self.pid,
+ status=job.status)
+ self.event('build.end', template, content)
+ finally:
+ # clean up the instance
+ if self.create:
+ self.terminate_instance(ip)
10 years, 6 months
[copr] master: normalize paths before using (7238506)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 723850608421c29caed89ae842d95f39aadb5cf4
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Oct 17 14:18:55 2013 +0200
normalize paths before using
this will get rid of /foo//bar etc.
Such paths make no harm, but normalizes are nicer
>---------------------------------------------------------------
backend/dispatcher.py | 6 +++---
backend/mockremote.py | 13 +++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index b1ace7e..c019ac9 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -197,7 +197,7 @@ class Worker(multiprocessing.Process):
jobdata.chroots = build['chroots'].split(' ')
jobdata.memory_reqs = build['memory_reqs']
jobdata.timeout = build['timeout']
- jobdata.destdir = self.opts.destdir + '/' + build['copr']['owner']['name'] + '/' + build['copr']['name'] + '/'
+ jobdata.destdir = os.path.normpath(self.opts.destdir + '/' + build['copr']['owner']['name'] + '/' + build['copr']['name'])
jobdata.build_id = build['id']
jobdata.results = self.opts.results_baseurl + '/' + build['copr']['owner']['name'] + '/' + build['copr']['name'] + '/'
jobdata.copr_id = build['copr']['id']
@@ -314,7 +314,7 @@ class Worker(multiprocessing.Process):
ip=ip, pid=self.pid)
self.event('chroot.start', template, content)
- chroot_destdir = job.destdir + '/' + chroot
+ chroot_destdir = os.path.normpath(job.destdir + '/' + chroot)
# setup our target dir locally
if not os.path.exists(chroot_destdir):
try:
@@ -337,7 +337,7 @@ class Worker(multiprocessing.Process):
self.callback.log('building pkgs: %s' % ' '.join(job.pkgs))
try:
chroot_repos = list(job.repos)
- chroot_repos.append(job.results + '/' + chroot)
+ chroot_repos.append(os.path.normpath(job.results + '/' + chroot))
chrootlogfile = chroot_destdir + '/build-%s.log' % job.build_id
mr = mockremote.MockRemote(builder=ip, timeout=job.timeout,
destdir=job.destdir, chroot=chroot, cont=True, recurse=True,
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 3f5f721..07acc5b 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -264,7 +264,7 @@ class Builder(object):
# $tempdir/build/results/$chroot/$packagename
s_pkg = os.path.basename(pkg)
pdn = s_pkg.replace('.src.rpm', '')
- remote_pkg_dir = self.remote_build_dir + '/results/' + self.chroot + '/' + pdn
+ remote_pkg_dir = os.path.normpath(self.remote_build_dir + '/results/' + self.chroot + '/' + pdn)
return remote_pkg_dir
def build(self, pkg):
@@ -280,7 +280,7 @@ class Builder(object):
# check if pkg is local or http
dest = None
if os.path.exists(pkg):
- dest = self.tempdir + '/' + os.path.basename(pkg)
+ dest = os.path.normpath(self.tempdir + '/' + os.path.basename(pkg))
self.conn.module_name = "copy"
margs = 'src=%s dest=%s' % (pkg, dest)
self.conn.module_args = str(margs)
@@ -474,7 +474,8 @@ class MockRemote(object):
self.callback.start_download(pkg)
# mockchain makes things with the chroot appended - so suck down
# that pkg subdir from w/i that location
- d_ret, d_out, d_err = self.builder.download(pkg, self.destdir + '/' + self.chroot)
+ chroot_dir = os.path.normpath(self.destdir + '/' + self.chroot)
+ d_ret, d_out, d_err = self.builder.download(pkg, chroot_dir)
if not d_ret:
msg = "Failure to download %s: %s" % (pkg, d_out + d_err)
if not self.cont:
@@ -483,9 +484,9 @@ class MockRemote(object):
self.callback.end_download(pkg)
# write out whatever came from the builder call into the destdir/chroot
- if not os.path.exists(self.destdir + '/' + self.chroot):
+ if not os.path.exists(chroot_dir):
os.makedirs(self.destdir + '/' + self.chroot)
- r_log = open(self.destdir + '/' + self.chroot + '/mockchain.log', 'a')
+ r_log = open(chroot_dir + '/mockchain.log', 'a')
r_log.write('\n\n%s\n\n' % pkg)
r_log.write(b_out)
if b_err:
@@ -509,7 +510,7 @@ class MockRemote(object):
self.callback.log("Success building %s" % os.path.basename(pkg))
built_pkgs.append(pkg)
# createrepo with the new pkgs
- for d in [self.destdir, self.destdir + '/' + self.chroot]:
+ for d in [self.destdir, chroot_dir]:
rc, out, err = createrepo(d)
if err.strip():
self.callback.error("Error making local repo: %s" % d)
10 years, 6 months