wrap sqlalchemy exceptions in a generic error
This commit is contained in:
@@ -61,7 +61,6 @@ import sys
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import IPy
|
import IPy
|
||||||
from sqlalchemy import exc
|
|
||||||
|
|
||||||
# If ../nova/__init__.py exists, add ../ to Python search path, so that
|
# If ../nova/__init__.py exists, add ../ to Python search path, so that
|
||||||
# it will override what happens to be installed in /usr/(local/)lib/python...
|
# it will override what happens to be installed in /usr/(local/)lib/python...
|
||||||
@@ -280,7 +279,7 @@ class UserCommands(object):
|
|||||||
arguments: name [access] [secret]"""
|
arguments: name [access] [secret]"""
|
||||||
try:
|
try:
|
||||||
user = self.manager.create_user(name, access, secret, True)
|
user = self.manager.create_user(name, access, secret, True)
|
||||||
except exc.OperationalError, e:
|
except exception.DBError, e:
|
||||||
_db_error(e)
|
_db_error(e)
|
||||||
self._print_export(user)
|
self._print_export(user)
|
||||||
|
|
||||||
@@ -289,7 +288,7 @@ class UserCommands(object):
|
|||||||
arguments: name [access] [secret]"""
|
arguments: name [access] [secret]"""
|
||||||
try:
|
try:
|
||||||
user = self.manager.create_user(name, access, secret, False)
|
user = self.manager.create_user(name, access, secret, False)
|
||||||
except exc.OperationalError, e:
|
except exception.DBError, e:
|
||||||
_db_error(e)
|
_db_error(e)
|
||||||
self._print_export(user)
|
self._print_export(user)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user