Commit 6a63f656 by e0d

refactor repeated code

parent 552a82ab
......@@ -76,12 +76,7 @@ class LifecycleHandler:
"--lifecycle-action-token {token}".format(
path=self.bin,asg=asg,token=token)
try:
output = subprocess.check_output(command.split(' '))
except Exception, e:
print e
print output
self.run_subprocess_command(command)
def continue_lifecycle(self, asg, token):
command = "{path}/python " \
......@@ -90,6 +85,11 @@ class LifecycleHandler:
"CONTINUE".format(
path=self.bin, asg=asg, token=token)
self.run_subprocess_command(command)
def run_subprocess_command(self,command):
logging.info("Running command {command}.".format(command=command))
try:
output = subprocess.check_output(command.split(' '))
except Exception, e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment