-##############################################################################\r
-# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are made available under the terms of the Apache License, Version 2.0\r
-# which accompanies this distribution, and is available at\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-##############################################################################\r
-\r
-import os\r
-\r
-\r
-class TestStep(object):\r
- def __init__(self, type, id, name, service, action, args, context):\r
- self._type = type\r
- self._id = id\r
- self._name = name\r
- self._serviceName = service['name']\r
- self._serviceInterface = service['interface']\r
- self._action = action\r
- self._args = args\r
- self._context = context\r
-\r
- def getId(self):\r
- return self._id\r
-\r
- def getName(self):\r
- return self._name\r
-\r
- def getServiceName(self):\r
- return self._serviceName\r
-\r
- def getCallFunction(self):\r
- return self._callType\r
-\r
- def getArgs(self):\r
- return self._args\r
-\r
- def action(self):\r
- f = getattr(self, self._action)\r
- f()\r
-\r
- def _argsParse(self):\r
- pass\r
-\r
- def _getCurrentDir(self):\r
- return os.path.dirname(__file__)\r
-\r
- def __str__(self):\r
- return str(self.__dict__)\r
-\r
-\r
-if __name__ == "__main__":\r
- args = {'command': 'start'}\r
- stepObj = TestStep('test_cpu', 'ansible', 'REST', **args)\r
- print stepObj\r
+##############################################################################
+# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+import os
+
+
+class TestStep(object):
+ def __init__(self, type, id, name, service, action, args, context):
+ self._type = type
+ self._id = id
+ self._name = name
+ self._serviceName = service['name']
+ self._serviceInterface = service['interface']
+ self._action = action
+ self._args = args
+ self._context = context
+
+ def getId(self):
+ return self._id
+
+ def getName(self):
+ return self._name
+
+ def getServiceName(self):
+ return self._serviceName
+
+ def getCallFunction(self):
+ return self._callType
+
+ def getArgs(self):
+ return self._args
+
+ def action(self):
+ f = getattr(self, self._action)
+ f()
+
+ def _argsParse(self):
+ pass
+
+ def _getCurrentDir(self):
+ return os.path.dirname(__file__)
+
+ def __str__(self):
+ return str(self.__dict__)
+
+
+if __name__ == "__main__":
+ args = {'command': 'start'}
+ stepObj = TestStep('test_cpu', 'ansible', 'REST', **args)
+ print stepObj