Fixed pep8

This commit is contained in:
Timur Nurlygayanov
2015-03-17 10:44:58 +03:00
parent 0d2fb83192
commit ae929eabe1

View File

@@ -16,30 +16,30 @@ class CloudNodesContext(base.Context):
"additionalProperties": False,
"properties": {}
}
ACTIONS = {
"stop rabbitmq service": {
"do": "/etc/init.d/rabbitmq-server stop",
"undo": "/etc/init.d/rabbitmq-server start"
},
"ban rabbitmq service with pcs": {
"do": "pcs resource ban rabbitmq",
"undo": "pcs resource clear rabbitmq"
}
}
ACTIONS = {
"stop rabbitmq service": {
"do": "/etc/init.d/rabbitmq-server stop",
"undo": "/etc/init.d/rabbitmq-server start"
},
"ban rabbitmq service with pcs": {
"do": "pcs resource ban rabbitmq",
"undo": "pcs resource clear rabbitmq"
}
}
def setup(self):
"""This method is called before the task start"""
self.context["actions"] = self.ACTIONS
# done_actions contains information about name of shaiker_id
# and action name which were executed, example:
# self.context["done_actions"] = [{"name": "node-1", "command": "ls"}]
self.context["done_actions"] = []
# done_actions contains information about name of shaiker_id
# and action name which were executed, example:
# self.context["done_actions"] = [{"name": "node-1", "command": "ls"}]
self.context["done_actions"] = []
def cleanup(self):
"""This method is called after the task finish"""
for action in self.context["done_actions"]:
## we need to import shaiker somehow :)
## we need to import shaiker somehow :)
shaiker.run_command_on_node(action["node"],
ACTIONS[action["command"]]["undo"])
ACTIONS[action["command"]]["undo"])