Fixed exception issues

This commit is contained in:
Martin Magr
2013-01-07 13:08:37 +01:00
parent 3cdf3065ec
commit f03d72d1af
3 changed files with 16 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from .common_utils import UtilsNetworkError, forceIP
from .exceptions import ParamProcessingError
from .common_utils import forceIP
from .exceptions import ParamProcessingError, NetworkError
__all__ = ('ParamProcessingError', 'processHost')
@@ -16,5 +16,5 @@ def processHost(param, process_args=None):
process_args.get('allow_localhost', False)
try:
return forceIP(param, allow_localhost=localhost)
except UtilsNetworkError, ex:
except NetworkError, ex:
raise ParamProcessingError(str(ex))

View File

@@ -1,6 +1,17 @@
# -*- coding: utf-8 -*-
__all__ = ()
__all__ = (
'PackStackError',
'InstallError',
'FlagValidationError',
'PluginError',
'ParamProcessingError',
'NetworkError',
'ScriptRuntimeError',
)
class PackStackError(Exception):

View File

@@ -101,6 +101,7 @@ def waitforpuppet(currently_running):
except ScriptRuntimeError, e:
# the test raises an exception if the file doesn't exist yet
# TO-DO: We need to start testing 'e' for unexpected exceptions
time.sleep(3)
print
continue