New exit code (4) indicating gbp crashes
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 16 Feb 2015 15:33:08 +0000 (17:33 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 16 Feb 2015 15:38:57 +0000 (17:38 +0200)
The service now returns 4 when gbp crashes on an unhandled exception.

Change-Id: Ic202f8bd921eea5a3b76a593fd973658d36df9bb
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
obs_service_gbp/command.py
tests/test_obs_service_gbp.py

index 0ab2754..a11a869 100644 (file)
@@ -43,6 +43,7 @@ EXIT_OK = 0
 EXIT_ERR_SERVICE = 1
 EXIT_ERR_RPM_EXPORT = 2
 EXIT_ERR_DEB_EXPORT = 3
+EXIT_ERR_GBP_CRASH = 4
 
 
 class ExportError(Exception):
@@ -173,7 +174,7 @@ def gbp_export(repo, args, config):
         LOGGER.error('Unhandled exception in GBP:\n'
                      '%s', err.prettyprint_tb())
         raise ExportError('Failed to export packaging files',
-                          EXIT_ERR_SERVICE)
+                          EXIT_ERR_GBP_CRASH)
     except GbpServiceError as err:
         LOGGER.error('Internal service error when trying to run GBP: %s', err)
         raise ExportError('This is most likely a configuration error (or a '
index 17ba0cc..29f4844 100644 (file)
@@ -107,12 +107,12 @@ class TestService(UnitTestsBase):
     @mock.patch('obs_service_gbp.command.gbp_deb', _mock_gbp)
     def test_deb_crash(self):
         """Test crash in git-buildpackage"""
-        eq_(service(['--url', self.orig_repo.path, '--revision=deb']), 1)
+        eq_(service(['--url', self.orig_repo.path, '--revision=deb']), 4)
 
     @mock.patch('obs_service_gbp.command.gbp_rpm', _mock_gbp)
     def test_rpm_crash(self):
         """Test crash in git-buildpackage-rpm"""
-        eq_(service(['--url', self.orig_repo.path, '--revision=rpm']), 1)
+        eq_(service(['--url', self.orig_repo.path, '--revision=rpm']), 4)
 
     @mock.patch('obs_service_gbp.command.fork_call', _mock_fork_call)
     def test_service_error(self):