can't start an active guest and vice versa

This commit is contained in:
brent s. 2019-11-29 07:37:00 -05:00
parent 542166de67
commit add247d622

View File

@ -121,14 +121,14 @@ class LV(object):
return(results)

def restart(self, target, *args, **kwargs):
self.stop(target, **kwargs)
self.start(target, **kwargs)
self.stop(target, state = 'active', **kwargs)
self.start(target, state = 'inactive', **kwargs)
return()

def start(self, target, **kwargs):
if not self.conn:
self.startConn()
targets = self._getTargets(target, **kwargs)
targets = self._getTargets(target, state = 'inactive', **kwargs)
for t in targets:
t.create()
return()
@ -136,7 +136,7 @@ class LV(object):
def stop(self, target, force = False, *args, **kwargs):
if not self.conn:
self.startConn()
targets = self._getTargets(target, **kwargs)
targets = self._getTargets(target, state = 'active', **kwargs)
for t in targets:
if not force:
t.shutdown()
@ -218,5 +218,6 @@ def main():
print('\n'.join(f))
return()


if __name__ == '__main__':
main()