[ckan-changes] commit/ckan: dread: [cli][xs]: Add error handling for psql commands.

Bitbucket commits-noreply at bitbucket.org
Wed Aug 10 16:04:19 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/1b1410d768a2/
changeset:   1b1410d768a2
user:        dread
date:        2011-08-10 18:04:10
summary:     [cli][xs]: Add error handling for psql commands.
affected #:  1 file (112 bytes)

--- a/ckan/lib/cli.py	Wed Aug 10 16:43:56 2011 +0100
+++ b/ckan/lib/cli.py	Wed Aug 10 17:04:10 2011 +0100
@@ -157,7 +157,9 @@
 
     def _run_cmd(self, command_line):
         import subprocess    
-        subprocess.call(command_line, shell=True)
+        retcode = subprocess.call(command_line, shell=True)
+        if retcode != 0:
+            raise SystemError('Command exited with errorcode: %i' % retcode)
 
     def dump_or_load(self, cmd):
         if len(self.args) < 2:

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list