Fix host add by DHCP
This commit fix the issue to add a new host by adding a try except avoiding error. Test Plan: PASS: Add a new host with "system host-update 2 personality=controller" cmd. Closes-Bug: 2065636 Change-Id: Ie658058ab6cdbab042d8428f77a81499eb8fbc82 Signed-off-by: Luis Eduardo Bonatti <LuizEduardo.Bonatti@windriver.com>
This commit is contained in:
parent
180ac1df30
commit
982b1d89f1
|
@ -1933,8 +1933,12 @@ class ConductorManager(service.PeriodicService):
|
|||
sw_version = load.software_version
|
||||
else:
|
||||
# No load provided, look it up...
|
||||
host = self.dbapi.ihost_get_by_hostname(host.hostname)
|
||||
sw_version = host.sw_version
|
||||
try:
|
||||
host = self.dbapi.ihost_get_by_hostname(host.hostname)
|
||||
sw_version = host.sw_version
|
||||
except exception.NodeNotFound:
|
||||
LOG.debug("Host %s couldn't be found." % host.hostname)
|
||||
pass
|
||||
|
||||
if (host.personality == constants.CONTROLLER and
|
||||
constants.WORKER in tsc.subfunctions):
|
||||
|
|
Loading…
Reference in New Issue