server/serverctl.py
changeset 8695 358d8bed9626
parent 8669 62213a34726e
child 8749 9db7580d6427
--- a/server/serverctl.py	Thu Feb 14 15:39:23 2013 +0100
+++ b/server/serverctl.py	Thu Feb 14 15:38:25 2013 +0100
@@ -208,7 +208,7 @@
 def confirm_on_error_or_die(msg, func, *args, **kwargs):
     try:
         return func(*args, **kwargs)
-    except Exception, ex:
+    except Exception as ex:
         print 'ERROR', ex
         if not ASK.confirm('An error occurred while %s. Continue anyway?' % msg):
             raise ExecutionError(str(ex))
@@ -382,7 +382,7 @@
                 if automatic or ASK.confirm('Create language %s ?' % extlang):
                     try:
                         helper.create_language(cursor, extlang)
-                    except Exception, exc:
+                    except Exception as exc:
                         print '-> ERROR:', exc
                         print '-> could not create language %s, some stored procedures might be unusable' % extlang
                         cnx.rollback()
@@ -449,7 +449,7 @@
                 host=system.get('db-host'), port=system.get('db-port'),
                 user=system.get('db-user') or '', password=system.get('db-password') or '',
                 **extra)
-        except Exception, ex:
+        except Exception as ex:
             raise ConfigurationError(
                 'You seem to have provided wrong connection information in '\
                 'the %s file. Resolve this first (error: %s).'
@@ -552,7 +552,7 @@
         try:
             sqlexec(sqlgrants(schema, source['db-driver'], user,
                               set_owner=set_owner), cursor)
-        except Exception, ex:
+        except Exception as ex:
             cnx.rollback()
             import traceback
             traceback.print_exc()
@@ -620,7 +620,7 @@
             sconfig['password'] = pwd
             sourcescfg['admin'] = sconfig
             config.write_sources_file(sourcescfg)
-        except Exception, ex:
+        except Exception as ex:
             cnx.rollback()
             import traceback
             traceback.print_exc()
@@ -868,7 +868,7 @@
             if not self.config.no_drop:
                 try:
                     CWCTL.run(['db-create', '--automatic', appid])
-                except SystemExit, exc:
+                except SystemExit as exc:
                     # continue if the command exited with status 0 (success)
                     if exc.code:
                         raise
@@ -879,7 +879,7 @@
         if self.config.format == 'portable':
             try:
                 CWCTL.run(['db-rebuild-fti', appid])
-            except SystemExit, exc:
+            except SystemExit as exc:
                 if exc.code:
                     raise