Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 157e0cf03f5032313a917596520de5b3658cebc3
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Apr 30 14:50:47 2014 +0200
add newline at the end of repo file
so it looks nice when you cat it
>---------------------------------------------------------------
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 7d16d7c2e43f0d5fd3d01bda91ddedbe52f0bdef
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Tue Apr 29 15:04:32 2014 +0200
[cli] exit code 4 for failed build and man pages updated
>---------------------------------------------------------------
cli/copr_cli/copr_exceptions.py | 9 ++++++++-
cli/copr_cli/main.py | 3 +++
cli/copr_cli/subcommands.py | 2 +-
cli/man/copr-cli.1.asciidoc | 11 +++++++++++
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/cli/copr_cli/copr_exceptions.py b/cli/copr_cli/copr_exceptions.py
index 4be2f06..1e10678 100644
--- a/cli/copr_cli/copr_exceptions.py
+++ b/cli/copr_cli/copr_exceptions.py
@@ -26,12 +26,19 @@ class CoprCliConfigException(CoprCliException):
class CoprCliRequestException(Exception):
- """ Exception thrown when server says no. For example,
+ """ Exception thrown when the request is bad. For example,
the user provided wrong project name or build ID.
"""
pass
+class CoprCliBuildException(Exception):
+ """ Exception thrown when one or more builds fail and Cli is waiting
+ for the result.
+ """
+ pass
+
+
class CoprCliUnknownResponseException(Exception):
""" Exception thrown when the response is unknown to cli.
It usualy means that something is broken.
diff --git a/cli/copr_cli/main.py b/cli/copr_cli/main.py
index 477ac0e..597b57a 100644
--- a/cli/copr_cli/main.py
+++ b/cli/copr_cli/main.py
@@ -172,6 +172,9 @@ def main(argv=sys.argv[1:]):
except ConfigParser.ParsingError, e:
sys.stderr.write("\nError: {0}\n".format(e))
sys.stderr.write("Lines in INI file should not be indented.\n")
+ sys.exit(3)
+ except copr_exceptions.CoprCliBuildException, e:
+ sys.stderr.write("\nBuild error: {0}\n".format(e))
sys.exit(4)
except copr_exceptions.CoprCliUnknownResponseException, e:
sys.stderr.write("\nError: {0}\n".format(e))
diff --git a/cli/copr_cli/subcommands.py b/cli/copr_cli/subcommands.py
index 113a8bd..7f2215b 100644
--- a/cli/copr_cli/subcommands.py
+++ b/cli/copr_cli/subcommands.py
@@ -295,7 +295,7 @@ def build(copr, pkgs, memory, timeout, wait=True, result=None, chroots=None):
time.sleep(60)
if failed_ids:
- raise copr_exceptions.CoprCliRequestException(
+ raise copr_exceptions.CoprCliBuildException(
"Build(s) {0} failed.".format(
", ".join(str(x) for x in failed_ids)))
diff --git a/cli/man/copr-cli.1.asciidoc b/cli/man/copr-cli.1.asciidoc
index ef9ada9..b748ab9 100644
--- a/cli/man/copr-cli.1.asciidoc
+++ b/cli/man/copr-cli.1.asciidoc
@@ -101,6 +101,17 @@ pkg_url::
URL of the package to build. The package must be placed on a public web or
ftp server.
+EXIT STATUS
+-----------
+Normally, the exit code is 0 when everything goes well. But if not, we could get:
+1 - Bad request like wrong project name, insufficient rights etc.
+ Also might happen when user interrupts the operation when they shouldn't.
+2 - Wrong arguments given.
+3 - Bad or no configuration.
+4 - Build fails when Cli is waiting for the result.
+5 - Communication error between Cli and server.
+ This issue probably means bug and should be reported.
+
API KEY
-------
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 60b162dd18b1f56d09b3956a3a64db04a927ee02
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Apr 23 17:16:09 2014 +0200
if directory does not exist, do not try to delete it
addressing:
Process jobgrab:
Traceback (most recent call last):
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/share/copr/copr-be.py", line 104, in run
self.fetch_jobs()
File "/usr/share/copr/copr-be.py", line 97, in fetch_jobs
ao.run()
File "/usr/share/copr/backend/actions.py", line 51, in run
for chroot in os.listdir(path):
OSError: [Errno 2] No such file or directory: '/var/lib/copr/public_html/results/asamalik/test-project'
>---------------------------------------------------------------
backend/backend/actions.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/backend/backend/actions.py b/backend/backend/actions.py
index 63dafed..db4ae7b 100644
--- a/backend/backend/actions.py
+++ b/backend/backend/actions.py
@@ -48,7 +48,12 @@ class Action(object):
self.event("Packages to delete {0}".format(' '.join(packages)))
self.event("Copr path {0}".format(path))
- for chroot in os.listdir(path):
+ try:
+ chroot_list = os.listdir(path)
+ except OSError:
+ # already deleted
+ chroot_list = []
+ for chroot in chroot_list:
self.event("In chroot {0}".format(chroot))
altered = False