can't start an active guest and vice versa
This commit is contained in:
parent
542166de67
commit
add247d622
@ -121,14 +121,14 @@ class LV(object):
|
|||||||
return(results)
|
return(results)
|
||||||
|
|
||||||
def restart(self, target, *args, **kwargs):
|
def restart(self, target, *args, **kwargs):
|
||||||
self.stop(target, **kwargs)
|
self.stop(target, state = 'active', **kwargs)
|
||||||
self.start(target, **kwargs)
|
self.start(target, state = 'inactive', **kwargs)
|
||||||
return()
|
return()
|
||||||
|
|
||||||
def start(self, target, **kwargs):
|
def start(self, target, **kwargs):
|
||||||
if not self.conn:
|
if not self.conn:
|
||||||
self.startConn()
|
self.startConn()
|
||||||
targets = self._getTargets(target, **kwargs)
|
targets = self._getTargets(target, state = 'inactive', **kwargs)
|
||||||
for t in targets:
|
for t in targets:
|
||||||
t.create()
|
t.create()
|
||||||
return()
|
return()
|
||||||
@ -136,7 +136,7 @@ class LV(object):
|
|||||||
def stop(self, target, force = False, *args, **kwargs):
|
def stop(self, target, force = False, *args, **kwargs):
|
||||||
if not self.conn:
|
if not self.conn:
|
||||||
self.startConn()
|
self.startConn()
|
||||||
targets = self._getTargets(target, **kwargs)
|
targets = self._getTargets(target, state = 'active', **kwargs)
|
||||||
for t in targets:
|
for t in targets:
|
||||||
if not force:
|
if not force:
|
||||||
t.shutdown()
|
t.shutdown()
|
||||||
@ -218,5 +218,6 @@ def main():
|
|||||||
print('\n'.join(f))
|
print('\n'.join(f))
|
||||||
return()
|
return()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user