Skip to content

Commit

Permalink
Add the ability the get the status of a single machine
Browse files Browse the repository at this point in the history
  • Loading branch information
k3rn committed May 6, 2016
1 parent b5f92e5 commit 442bc4e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions floki/machines/__init__.py
Expand Up @@ -155,15 +155,20 @@ def suspend(self, env, groups):
finally:
print "failed."

def status(self, env, group):
def status(self, env, group, single):
running_list = self.get_list_running(self.vm.list(), env, group)
if len(running_list) is 0:
print 'No machine running'
if single is None:
if len(running_list) is 0:
print 'No machine running'
else:
print "Machines running:"
for machine in running_list:
print machine
print "Total: %s machine(s) running" % len(running_list)
elif single in running_list:
print "The machine %s is running." % single
else:
print "Machines running:"
for machine in running_list:
print machine
print "Total: %s machine(s) running" % len(running_list)
print "The machine %s is not running." % single

def create(self, env, groups):
machine_list = self.get_list(env, groups)
Expand Down

0 comments on commit 442bc4e

Please sign in to comment.