FORGE: Added including script
[myslice.git] / forge / script / exceptionDefinition.py
1 #!/usr/bin/python
2
3 class FailToConnect(Exception):
4         def __init__(self, nodeId, nodeUrl):
5                 self.nodeId = nodeId
6                 self.nodeUrl = nodeUrl
7         def __str__(self):
8                 return repr(self.siteId)
9         def getNodeId(self):
10                 return self.nodeId
11         def getNodeUrl(self):
12                 return self.nodeUrl
13
14 class SSHConnectError(Exception):
15         def __init__(self, host, sliceName):
16                 self.why = "Can't connect to the node "+str(sliceName)+"@"+str(host)
17         
18         def __str__(self):
19          return repr(self.why)
20
21 class NodeConstraintError(Exception):
22         def __init__(self, constraint, envList):
23                 self.why = "Can't find node with constraint : "+str(constraint)
24                 self.envList = envList
25
26         def getEnvList(self):
27                 return self.envList