Update exception.py

- rename NovaException -> IronicException
- remove many unused exceptions
This commit is contained in:
Devananda van der Veen 2013-05-11 09:36:27 -07:00
parent fed78f5dfd
commit 537def2b1a
4 changed files with 21 additions and 994 deletions
ironic

File diff suppressed because it is too large Load Diff

@ -90,7 +90,7 @@ def execute(*cmd, **kwargs):
:param run_as_root: True | False. Defaults to False. If set to True,
the command is run with rootwrap.
:raises exception.NovaException: on receiving unknown arguments
:raises exception.IronicException: on receiving unknown arguments
:raises exception.ProcessExecutionError:
:returns: a tuple, (stdout, stderr) from the spawned process, or None if
@ -110,7 +110,7 @@ def execute(*cmd, **kwargs):
shell = kwargs.pop('shell', False)
if len(kwargs):
raise exception.NovaException(_('Got unknown keyword args '
raise exception.IronicException(_('Got unknown keyword args '
'to utils.execute: %r') % kwargs)
if run_as_root and os.geteuid() != 0:
@ -200,12 +200,12 @@ def ssh_execute(ssh, cmd, process_input=None,
addl_env=None, check_exit_code=True):
LOG.debug(_('Running cmd (SSH): %s'), cmd)
if addl_env:
raise exception.NovaException(_('Environment not supported over SSH'))
raise exception.IronicException(_('Environment not supported over SSH'))
if process_input:
# This is (probably) fixable if we need it...
msg = _('process_input not supported over SSH')
raise exception.NovaException(msg)
raise exception.IronicException(msg)
stdin_stream, stdout_stream, stderr_stream = ssh.exec_command(cmd)
channel = stdout_stream.channel
@ -261,7 +261,7 @@ class LazyPluggable(object):
backend_name = CONF[self.__config_group][self.__pivot]
if backend_name not in self.__backends:
msg = _('Invalid backend: %s') % backend_name
raise exception.NovaException(msg)
raise exception.IronicException(msg)
backend = self.__backends[backend_name]
if isinstance(backend, tuple):

@ -65,7 +65,7 @@ def db_sync(version=None):
try:
version = int(version)
except ValueError:
raise exception.NovaException(_("version should be an integer"))
raise exception.IronicException(_("version should be an integer"))
current_version = db_version()
repository = _find_migrate_repo()
@ -91,7 +91,7 @@ def db_version():
else:
# Some pre-Essex DB's may not be version controlled.
# Require them to upgrade using Essex first.
raise exception.NovaException(
raise exception.IronicException(
_("Upgrade DB using Essex release first."))

@ -129,7 +129,7 @@ exit 1
os.unlink(tmpfilename2)
def test_unknown_kwargs_raises_error(self):
self.assertRaises(exception.NovaException,
self.assertRaises(exception.IronicException,
utils.execute,
'/usr/bin/env', 'true',
this_is_not_a_valid_kwarg=True)