Merge "Report port and device inventory after the worker manifest"
This commit is contained in:
commit
5c1569362b
|
@ -224,7 +224,8 @@ class AgentManager(service.PeriodicService):
|
||||||
self._first_grub_update = False
|
self._first_grub_update = False
|
||||||
self._inventoried_initial = False
|
self._inventoried_initial = False
|
||||||
self._inventory_reported = set()
|
self._inventory_reported = set()
|
||||||
self._first_boot_flag = os.path.exists(FIRST_BOOT_FLAG)
|
self._first_boot_flag = os.path.exists(FIRST_BOOT_FLAG) or \
|
||||||
|
os.path.exists(constants.VOLATILE_FIRST_BOOT_FLAG)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
super(AgentManager, self).start()
|
super(AgentManager, self).start()
|
||||||
|
@ -579,6 +580,14 @@ class AgentManager(service.PeriodicService):
|
||||||
host_uuid,
|
host_uuid,
|
||||||
msg_dict)
|
msg_dict)
|
||||||
if os.path.exists(FIRST_BOOT_FLAG):
|
if os.path.exists(FIRST_BOOT_FLAG):
|
||||||
|
# Create volatile first_boot file, that will be checked by agent manager
|
||||||
|
# when it get crashed and restarted, so that it will know this boot is still
|
||||||
|
# first boot.
|
||||||
|
try:
|
||||||
|
os.mknod(constants.VOLATILE_FIRST_BOOT_FLAG)
|
||||||
|
except OSError:
|
||||||
|
LOG.error("%s could not be created." % constants.VOLATILE_FIRST_BOOT_FLAG)
|
||||||
|
|
||||||
os.remove(FIRST_BOOT_FLAG)
|
os.remove(FIRST_BOOT_FLAG)
|
||||||
LOG.info("Removed %s" % FIRST_BOOT_FLAG)
|
LOG.info("Removed %s" % FIRST_BOOT_FLAG)
|
||||||
except exception.SysinvException:
|
except exception.SysinvException:
|
||||||
|
|
|
@ -2120,6 +2120,7 @@ DEFAULT_DNS_SERVICE_DOMAIN = 'cluster.local'
|
||||||
|
|
||||||
# First boot
|
# First boot
|
||||||
FIRST_BOOT_FLAG = os.path.join(tsc.PLATFORM_CONF_PATH, ".first_boot")
|
FIRST_BOOT_FLAG = os.path.join(tsc.PLATFORM_CONF_PATH, ".first_boot")
|
||||||
|
VOLATILE_FIRST_BOOT_FLAG = os.path.join(tsc.VOLATILE_PATH, ".first_boot")
|
||||||
|
|
||||||
# Ansible bootstrap
|
# Ansible bootstrap
|
||||||
ANSIBLE_BOOTSTRAP_FLAG = os.path.join(tsc.VOLATILE_PATH, ".ansible_bootstrap")
|
ANSIBLE_BOOTSTRAP_FLAG = os.path.join(tsc.VOLATILE_PATH, ".ansible_bootstrap")
|
||||||
|
|
Loading…
Reference in New Issue