projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix issue storing status of k8s_helm_conn
[osm/N2VC.git]
/
n2vc
/
exceptions.py
diff --git
a/n2vc/exceptions.py
b/n2vc/exceptions.py
index
815d4ea
..
061cd7a
100644
(file)
--- a/
n2vc/exceptions.py
+++ b/
n2vc/exceptions.py
@@
-17,10
+17,26
@@
class JujuCharmNotFound(Exception):
"""The Charm can't be found or is not readable."""
"""The Charm can't be found or is not readable."""
+class JujuControllerFailedConnecting(Exception):
+ """Failed connecting to juju controller."""
+
+
+class JujuModelAlreadyExists(Exception):
+ """The model already exists."""
+
+
class JujuApplicationExists(Exception):
"""The Application already exists."""
class JujuApplicationExists(Exception):
"""The Application already exists."""
+class JujuApplicationNotFound(Exception):
+ """The Application cannot be found."""
+
+
+class JujuMachineNotFound(Exception):
+ """The machine cannot be found."""
+
+
class N2VCPrimitiveExecutionFailed(Exception):
"""Something failed while attempting to execute a primitive."""
class N2VCPrimitiveExecutionFailed(Exception):
"""Something failed while attempting to execute a primitive."""
@@
-41,7
+57,7
@@
class AuthenticationFailed(Exception):
"""The authentication for the specified user failed."""
"""The authentication for the specified user failed."""
-class NotImplemented(Exception):
+class
Method
NotImplemented(Exception):
"""The method is not implemented."""
"""The method is not implemented."""
@@
-50,7
+66,7
@@
class N2VCException(Exception):
N2VC exception base class
"""
N2VC exception base class
"""
- def __init__(self, message: str =
''
):
+ def __init__(self, message: str =
""
):
Exception.__init__(self, message)
self.message = message
Exception.__init__(self, message)
self.message = message
@@
-58,7
+74,7
@@
class N2VCException(Exception):
return self.message
def __repr__(self):
return self.message
def __repr__(self):
- return
'{}({})'
.format(type(self), self.message)
+ return
"{}({})"
.format(type(self), self.message)
class N2VCBadArgumentsException(N2VCException):
class N2VCBadArgumentsException(N2VCException):
@@
-66,12
+82,14
@@
class N2VCBadArgumentsException(N2VCException):
Bad argument values exception
"""
Bad argument values exception
"""
- def __init__(self, message: str =
''
, bad_args: list = None):
+ def __init__(self, message: str =
""
, bad_args: list = None):
N2VCException.__init__(self, message=message)
self.bad_args = bad_args
def __str__(self):
N2VCException.__init__(self, message=message)
self.bad_args = bad_args
def __str__(self):
- return '<{}> Bad arguments: {} -> {}'.format(type(self), super().__str__(), self.bad_args)
+ return "<{}> Bad arguments: {} -> {}".format(
+ type(self), super().__str__(), self.bad_args
+ )
class N2VCConnectionException(N2VCException):
class N2VCConnectionException(N2VCException):
@@
-79,12
+97,14
@@
class N2VCConnectionException(N2VCException):
Error connecting to VCA
"""
Error connecting to VCA
"""
- def __init__(self, message: str =
''
, url: str = None):
+ def __init__(self, message: str =
""
, url: str = None):
N2VCException.__init__(self, message=message)
self.url = url
def __str__(self):
N2VCException.__init__(self, message=message)
self.url = url
def __str__(self):
- return '<{}> Connection to {} failed: {}'.format(type(self), self.url, super().__str__())
+ return "<{}> Connection to {} failed: {}".format(
+ type(self), self.url, super().__str__()
+ )
class N2VCTimeoutException(N2VCException):
class N2VCTimeoutException(N2VCException):
@@
-92,12
+112,12
@@
class N2VCTimeoutException(N2VCException):
Timeout
"""
Timeout
"""
- def __init__(self, message: str =
'', timeout: str = ''
):
+ def __init__(self, message: str =
"", timeout: str = ""
):
N2VCException.__init__(self, message=message)
self.timeout = timeout
def __str__(self):
N2VCException.__init__(self, message=message)
self.timeout = timeout
def __str__(self):
- return
'<{}> {} timeout: {}'
.format(type(self), self.timeout, super().__str__())
+ return
"<{}> {} timeout: {}"
.format(type(self), self.timeout, super().__str__())
class N2VCExecutionException(N2VCException):
class N2VCExecutionException(N2VCException):
@@
-105,12
+125,14
@@
class N2VCExecutionException(N2VCException):
Error executing primitive
"""
Error executing primitive
"""
- def __init__(self, message: str =
'', primitive_name: str = ''
):
+ def __init__(self, message: str =
"", primitive_name: str = ""
):
N2VCException.__init__(self, message=message)
self.primitive_name = primitive_name
def __str__(self):
N2VCException.__init__(self, message=message)
self.primitive_name = primitive_name
def __str__(self):
- return '<{}> Error executing primitive {} failed: {}'.format(type(self), self.primitive_name, super().__str__())
+ return "<{}> Error executing primitive {} failed: {}".format(
+ type(self), self.primitive_name, super().__str__()
+ )
class N2VCInvalidCertificate(N2VCException):
class N2VCInvalidCertificate(N2VCException):
@@
-118,11
+140,11
@@
class N2VCInvalidCertificate(N2VCException):
Invalid certificate
"""
Invalid certificate
"""
- def __init__(self, message: str =
''
):
+ def __init__(self, message: str =
""
):
N2VCException.__init__(self, message=message)
def __str__(self):
N2VCException.__init__(self, message=message)
def __str__(self):
- return
'<{}> Invalid certificate: {}'
.format(type(self), super().__str__())
+ return
"<{}> Invalid certificate: {}"
.format(type(self), super().__str__())
class N2VCNotFound(N2VCException):
class N2VCNotFound(N2VCException):
@@
-130,11
+152,11
@@
class N2VCNotFound(N2VCException):
Not found
"""
Not found
"""
- def __init__(self, message: str =
''
):
+ def __init__(self, message: str =
""
):
N2VCException.__init__(self, message=message)
def __str__(self):
N2VCException.__init__(self, message=message)
def __str__(self):
- return
'<{}> Not found: {}'
.format(type(self), super().__str__())
+ return
"<{}> Not found: {}"
.format(type(self), super().__str__())
class K8sException(Exception):
class K8sException(Exception):
@@
-151,3
+173,7
@@
class K8sException(Exception):
def __repr__(self):
return self._message
def __repr__(self):
return self._message
+
+
+class EntityInvalidException(Exception):
+ """Entity is not valid, the type does not match any EntityType."""