Ignore "start" command if instance appears to be running

This helps preserving backward-compatible behaviour, as previous
implementation has required the user to explicitly "start" enabled
instances. With current virtualbmc, only the master process needs to
be started.

Change-Id: I3f95cdbd497f7ae3e06d37bb6afac17331f0469b
This commit is contained in:
Ilya Etingof 2019-02-14 11:13:12 +01:00
parent 89cc01b6d9
commit bff0e6c73a
2 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Ignores instance "start" command if instance appears to be running. This
helps preserving backward-compatible behaviour, as previous implementation
has required the user to explicitly "start" enabled instances. With current
virtualbmc, only the master process needs to be started.

View File

@ -286,8 +286,14 @@ class VirtualBMCManager(object):
return 1, str(ex)
if domain_name in self._running_domains:
return 1, ('BMC instance %(domain)s '
'already running' % {'domain': domain_name})
self._sync_vbmc_states()
if domain_name in self._running_domains:
LOG.warning(
'BMC instance %(domain)s already running, ignoring '
'"start" command' % {'domain': domain_name})
return 0, ''
try:
self._vbmc_enabled(domain_name,