Add IxNetwork API Python Binding package
[yardstick.git] / yardstick / common / exceptions.py
index 402b5b9..c78fecc 100644 (file)
@@ -21,6 +21,16 @@ class ProcessExecutionError(RuntimeError):
         self.returncode = returncode
 
 
+class ErrorClass(object):
+
+    def __init__(self, *args, **kwargs):
+        if 'test' not in kwargs:
+            raise RuntimeError
+
+    def __getattr__(self, item):
+        raise AttributeError
+
+
 class YardstickException(Exception):
     """Base Yardstick Exception.
 
@@ -54,6 +64,10 @@ class YardstickException(Exception):
         return False
 
 
+class ResourceCommandError(YardstickException):
+    message = 'Command: "%(command)s" Failed, stderr: "%(stderr)s"'
+
+
 class FunctionNotImplemented(YardstickException):
     message = ('The function "%(function_name)s" is not implemented in '
                '"%(class_name)" class.')
@@ -82,8 +96,58 @@ class DPDKSetupDriverError(YardstickException):
     message = '"igb_uio" driver is not loaded'
 
 
+class OVSUnsupportedVersion(YardstickException):
+    message = ('Unsupported OVS version "%(ovs_version)s". Please check the '
+               'config. OVS to DPDK version map: %(ovs_to_dpdk_map)s.')
+
+
+class OVSHugepagesInfoError(YardstickException):
+    message = 'MemInfo cannnot be retrieved.'
+
+
+class OVSHugepagesNotConfigured(YardstickException):
+    message = 'HugePages are not configured in this system.'
+
+
+class OVSHugepagesZeroFree(YardstickException):
+    message = ('There are no HugePages free in this system. Total HugePages '
+               'configured: %(total_hugepages)s')
+
+
+class OVSDeployError(YardstickException):
+    message = 'OVS deploy tool failed with error: %(stderr)s.'
+
+
+class OVSSetupError(YardstickException):
+    message = 'OVS setup error. Command: %(command)s. Error: %(error)s.'
+
+
+class LibvirtCreateError(YardstickException):
+    message = 'Error creating the virtual machine. Error: %(error)s.'
+
+
+class SSHError(YardstickException):
+    message = '%(error_msg)s'
+
+
+class SSHTimeout(SSHError):
+    pass
+
+
+class IncorrectConfig(YardstickException):
+    message = '%(error_msg)s'
+
+
+class IncorrectSetup(YardstickException):
+    message = '%(error_msg)s'
+
+
+class IncorrectNodeSetup(IncorrectSetup):
+    pass
+
+
 class ScenarioConfigContextNameNotFound(YardstickException):
-    message = 'Context name "%(context_name)s" not found'
+    message = 'Context for host name "%(host_name)s" not found'
 
 
 class StackCreationInterrupt(YardstickException):
@@ -132,3 +196,28 @@ class ScenarioRemoveRouterIntError(YardstickException):
 
 class ScenarioCreateFloatingIPError(YardstickException):
     message = 'Create Neutron Floating IP Scenario failed'
+
+
+class ScenarioDeleteFloatingIPError(YardstickException):
+    message = 'Delete Neutron Floating IP Scenario failed'
+
+
+class ApiServerError(YardstickException):
+    message = 'An unkown exception happened to Api Server!'
+
+
+class UploadOpenrcError(ApiServerError):
+    message = 'Upload openrc ERROR!'
+
+
+class UpdateOpenrcError(ApiServerError):
+    message = 'Update openrc ERROR!'
+
+
+class AclMissingActionArguments(YardstickException):
+    message = ('Missing ACL action parameter '
+               '[action=%(action_name)s parameter=%(action_param)s]')
+
+
+class AclUknownActionTemplate(YardstickException):
+    message = 'No ACL CLI template found for "%(action_name)s" action'