[copr] master: [cli] print errors to stderr (8ac4ae6)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8ac4ae60cd1d06a55f80f8d6c6a27b1dade651c1
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Dec 18 10:06:37 2013 +0100
[cli] print errors to stderr
>---------------------------------------------------------------
copr_cli/main.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/copr_cli/main.py b/copr_cli/main.py
index 072134c..47359e8 100644
--- a/copr_cli/main.py
+++ b/copr_cli/main.py
@@ -2,6 +2,7 @@
import argparse
import sys
+import ConfigParser
import subcommands
import copr_exceptions
@@ -124,18 +125,17 @@ def main(argv=sys.argv[1:]):
arg = parser.parse_args()
arg.func(arg)
except KeyboardInterrupt:
- print "\nInterrupted by user."
+ sys.stderr.write("\nInterrupted by user.")
sys.exit(1)
except argparse.ArgumentTypeError, e:
- print "\nError: {0}".format(e)
+ sys.stderr.write("\nError: {0}".format(e))
sys.exit(2)
except copr_exceptions.CoprCliException, e:
- print "\nError: {0}".format(e)
+ sys.stderr.write("\nError: {0}\n".format(e))
sys.exit(3)
except ConfigParser.ParsingError, e:
sys.stderr.write("\nError: {0}\n".format(e))
sys.stderr.write("Lines in INI file should not be indented.\n")
- print \n
sys.exit(4)
#except Exception, e:
#print 'Error: {0}'.format(e)
10 years, 4 months
[copr] master: 1044136 - do not print TB if config in mangled (62a7525)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 62a752586b331b8b415828643c0e0e6cac3cfdd6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Dec 18 10:04:59 2013 +0100
1044136 - do not print TB if config in mangled
>---------------------------------------------------------------
copr_cli/main.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/copr_cli/main.py b/copr_cli/main.py
index 25727a7..072134c 100644
--- a/copr_cli/main.py
+++ b/copr_cli/main.py
@@ -132,6 +132,11 @@ def main(argv=sys.argv[1:]):
except copr_exceptions.CoprCliException, e:
print "\nError: {0}".format(e)
sys.exit(3)
+ except ConfigParser.ParsingError, e:
+ sys.stderr.write("\nError: {0}\n".format(e))
+ sys.stderr.write("Lines in INI file should not be indented.\n")
+ print \n
+ sys.exit(4)
#except Exception, e:
#print 'Error: {0}'.format(e)
#sys.exit(100)
10 years, 4 months
[copr] master: 1044165 - Provide login and token information in the same form as entered to ~/.config-copr (230f923)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 230f9237929748609e89705c74c4ac8e3d4bc694
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Dec 18 09:32:54 2013 +0100
1044165 - Provide login and token information in the same form as entered to ~/.config-copr
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index 2a335ba..1ee4c2a 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -17,12 +17,15 @@
</p>
{% if g.user %}
- <p>Your information:</p>
+ <p>Your information (you can directly paste this into ~/.config/copr):</p>
<pre style="font-size:120%">
- API login : {{ g.user.api_login }}
- API token : {{ g.user.api_token }}
- Expiration date : {{ g.user.api_token_expiration }}
- </pre>
+[copr-cli]
+login = {{ g.user.api_login }}
+username = {{ g.user.name }}
+token = {{ g.user.api_token }}
+copr_url = http://copr.fedoraproject.org
+# expiration date: {{ g.user.api_token_expiration }}
+</pre>
<a href="{{ url_for('api_ns.api_new_token') }}">
<input type="button" value="Generate a new token" />
10 years, 4 months
[copr] master: [frontend] code cleanup (ee05e1f)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit ee05e1fc0c02202a8b92ab768c5884af8354b27b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Dec 17 17:30:17 2013 +0100
[frontend] code cleanup
this is already defined few lines above
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 6dddfdc..3525bc8 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -320,7 +320,6 @@ def generate_repo_file(username, coprname, chroot):
if '-' not in reponame:
return page_not_found('Bad repository name: {0}. Must be username-projectname'.format(reponame))
- username, coprname = reponame.split('-', 1)
copr = None
try:
# query.one() is used since it fetches all builds, unlike query.first().
10 years, 4 months
[copr] master: [frontend] move rendering of .repo file to helpers (2bd9280)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 2bd9280e0b1a03f52bf186f519260f36847c6bf3
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Dec 17 17:29:17 2013 +0100
[frontend] move rendering of .repo file to helpers
>---------------------------------------------------------------
coprs_frontend/coprs/helpers.py | 9 ++++++++-
.../coprs/views/coprs_ns/coprs_general.py | 9 ++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/coprs_frontend/coprs/helpers.py b/coprs_frontend/coprs/helpers.py
index f4efac0..19b2820 100644
--- a/coprs_frontend/coprs/helpers.py
+++ b/coprs_frontend/coprs/helpers.py
@@ -1,7 +1,7 @@
import math
import random
import string
-
+import urlparse
import flask
from coprs import constants
@@ -127,3 +127,10 @@ def parse_package_name(pkg):
return result[:-1]
return pkg
+
+def render_repo(copr, mock_chroot, url):
+ """ Render .repo file. No checks if copr or mock_chroot exists. """
+ if mock_chroot.os_release == "fedora":
+ mock_chroot.os_version = '$releasever'
+ url = urlparse.urljoin(url, "%s-%s-%s/" % (mock_chroot.os_release, mock_chroot.os_version, '$basearch'))
+ return flask.render_template('coprs/copr.repo', copr=copr, url=url)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index b944f81..6dddfdc 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -5,7 +5,6 @@ import flask
import platform
import smtplib
import sqlalchemy
-import urlparse
from email.mime.text import MIMEText
from coprs import app
@@ -21,7 +20,7 @@ from coprs.views.coprs_ns import coprs_ns
from coprs.logic import builds_logic
from coprs.logic import coprs_logic
-from coprs.helpers import parse_package_name
+from coprs.helpers import parse_package_name, render_repo
@coprs_ns.route('/', defaults = {'page': 1})
@@ -344,11 +343,7 @@ def generate_repo_file(username, coprname, chroot):
if not url:
return page_not_found('Repository not initialized: No finished builds in {0}/{1}.'.format(username, coprname))
- if mock_chroot.os_release == "fedora":
- mock_chroot.os_version = '$releasever'
- url = urlparse.urljoin(url, "%s-%s-%s/" % (mock_chroot.os_release, mock_chroot.os_version, '$basearch'))
-
- response = flask.make_response(flask.render_template('coprs/copr.repo', copr=copr, url=url))
+ response = flask.make_response(render_repo(copr, mock_chroot, url))
response.mimetype='text/plain'
response.headers['Content-Disposition'] = 'filename=%s.repo' % reponame
return response
10 years, 4 months
[copr] master: 1043649 - in case of Fedora use $releasever in repo file (0d0b705)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 0d0b705098a3a8f142a83cb20522d0b77da9bf17
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Dec 17 14:07:45 2013 +0100
1043649 - in case of Fedora use $releasever in repo file
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 186490f..b944f81 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -344,6 +344,8 @@ def generate_repo_file(username, coprname, chroot):
if not url:
return page_not_found('Repository not initialized: No finished builds in {0}/{1}.'.format(username, coprname))
+ if mock_chroot.os_release == "fedora":
+ mock_chroot.os_version = '$releasever'
url = urlparse.urljoin(url, "%s-%s-%s/" % (mock_chroot.os_release, mock_chroot.os_version, '$basearch'))
response = flask.make_response(flask.render_template('coprs/copr.repo', copr=copr, url=url))
10 years, 4 months
[copr] master: [frontend] condition should be in reverse (e4ab53a)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit e4ab53a6babf568ce1b4653760d50fab20023a67
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Dec 17 09:18:38 2013 +0100
[frontend] condition should be in reverse
otherwise every sucessfull build end up with traceback
>---------------------------------------------------------------
.../coprs/views/backend_ns/backend_general.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/views/backend_ns/backend_general.py b/coprs_frontend/coprs/views/backend_ns/backend_general.py
index 01f7fab..29bac58 100644
--- a/coprs_frontend/coprs/views/backend_ns/backend_general.py
+++ b/coprs_frontend/coprs/views/backend_ns/backend_general.py
@@ -79,7 +79,7 @@ def update():
i -= 1
exc_info = sys.exc_info()[2]
time.sleep(5)
- if i == -100:
+ if i != -100:
raise LockError, None, exc_info
result.update({'updated_{0}_ids'.format(typ): list(existing.keys()),
10 years, 4 months
[copr] master: Automatic commit of package [copr] release [1.19-1]. (66ebdbe)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 66ebdbe2ad438d24fa40ea4500d34598a916d951
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Dec 16 15:38:13 2013 +0100
Automatic commit of package [copr] release [1.19-1].
>---------------------------------------------------------------
copr.spec | 15 ++++++++++++++-
rel-eng/packages/copr | 2 +-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/copr.spec b/copr.spec
index 11f87b4..ab44d92 100644
--- a/copr.spec
+++ b/copr.spec
@@ -6,7 +6,7 @@
%global modulename copr
Name: copr
-Version: 1.18
+Version: 1.19
Release: 1%{?dist}
Summary: Cool Other Package Repo
@@ -383,6 +383,19 @@ fi
%{_mandir}/man8/%{name}-selinux-relabel.8*
%changelog
+* Mon Dec 16 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.19-1
+- [backend] log real cause if ansible crash
+- [frontend] try again if whoosh does not get lock
+- [backend] if frontend does not respond, repeat
+- print yum repos nicely
+- Bump the copr-cli release to 0.2.0 with all the changes made
+- Refer to the man page for more information about the configuration file for
+ copr-cli
+- Rework the layout of the list command
+- Fix parsing the copr_url from the configuration file
+- [backend] run createrepo as copr user
+- 1040615 - wrap lines with long URL
+
* Wed Dec 11 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.18-1
- [frontend] inicialize variable
diff --git a/rel-eng/packages/copr b/rel-eng/packages/copr
index 60526d6..4ca2ca3 100644
--- a/rel-eng/packages/copr
+++ b/rel-eng/packages/copr
@@ -1 +1 @@
-1.18-1 ./
+1.19-1 ./
10 years, 4 months
[copr] master: [backend] log real cause if ansible crash (89f383f)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 89f383fc8cca4c398d05acca855ab021dea6a794
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Dec 16 15:06:03 2013 +0100
[backend] log real cause if ansible crash
addressing:
Process worker-builder:
Traceback (most recent call last):
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/share/copr/backend/dispatcher.py", line 302, in run
ip = self.spawn_instance()
File "/usr/share/copr/backend/dispatcher.py", line 165, in spawn_instance
shell=True)
File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command 'ansible-playbook -c ssh /home/copr/provision/builderpb.yml' returned non-zero exit status 2
>---------------------------------------------------------------
backend/dispatcher.py | 9 +++++++--
.../coprs/views/coprs_ns/coprs_general.py | 6 +++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index fee9f3d..86bbbfc 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -161,8 +161,13 @@ class Worker(multiprocessing.Process):
# 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)
+ try:
+ result = subprocess.check_output("ansible-playbook -c ssh %s" % self.opts.spawn_playbook,
+ shell=True)
+ except subprocess.CalledProcessError:
+ sys.stderr.write("%s\n" % result)
+ self.callback.log("CalledProcessError: %s" % result)
+ raise subprocess.CalledProcessError, None, sys.exc_info()[2]
self.callback.log('Raw output from playbook: %s' % result)
match = re.search(r'IP=([^\{\}"]+)', result, re.MULTILINE)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 03898fc..186490f 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -64,7 +64,11 @@ def coprs_by_allowed(username=None, page=1):
@coprs_ns.route('/fulltext/<int:page>/')
def coprs_fulltext_search(page=1):
fulltext = flask.request.args.get('fulltext', '')
- query = coprs_logic.CoprsLogic.get_multiple_fulltext(flask.g.user, fulltext)
+ try:
+ query = coprs_logic.CoprsLogic.get_multiple_fulltext(flask.g.user, fulltext)
+ except ValueError, e:
+ flask.flash(str(e))
+ return flask.redirect(flask.request.referrer or flask.url_for('coprs_ns.coprs_show'))
paginator = helpers.Paginator(query, query.count(), page)
coprs = paginator.sliced_query
10 years, 4 months