Fixed pep8
This commit is contained in:
@@ -17,29 +17,29 @@ class CloudNodesContext(base.Context):
|
|||||||
"properties": {}
|
"properties": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTIONS = {
|
ACTIONS = {
|
||||||
"stop rabbitmq service": {
|
"stop rabbitmq service": {
|
||||||
"do": "/etc/init.d/rabbitmq-server stop",
|
"do": "/etc/init.d/rabbitmq-server stop",
|
||||||
"undo": "/etc/init.d/rabbitmq-server start"
|
"undo": "/etc/init.d/rabbitmq-server start"
|
||||||
},
|
},
|
||||||
"ban rabbitmq service with pcs": {
|
"ban rabbitmq service with pcs": {
|
||||||
"do": "pcs resource ban rabbitmq",
|
"do": "pcs resource ban rabbitmq",
|
||||||
"undo": "pcs resource clear rabbitmq"
|
"undo": "pcs resource clear rabbitmq"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""This method is called before the task start"""
|
"""This method is called before the task start"""
|
||||||
self.context["actions"] = self.ACTIONS
|
self.context["actions"] = self.ACTIONS
|
||||||
|
|
||||||
# done_actions contains information about name of shaiker_id
|
# done_actions contains information about name of shaiker_id
|
||||||
# and action name which were executed, example:
|
# and action name which were executed, example:
|
||||||
# self.context["done_actions"] = [{"name": "node-1", "command": "ls"}]
|
# self.context["done_actions"] = [{"name": "node-1", "command": "ls"}]
|
||||||
self.context["done_actions"] = []
|
self.context["done_actions"] = []
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""This method is called after the task finish"""
|
"""This method is called after the task finish"""
|
||||||
for action in self.context["done_actions"]:
|
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"],
|
shaiker.run_command_on_node(action["node"],
|
||||||
ACTIONS[action["command"]]["undo"])
|
ACTIONS[action["command"]]["undo"])
|
||||||
|
|||||||
Reference in New Issue
Block a user