Merge "Enhance logging for dcaudit and dcorch"

This commit is contained in:
Zuul 2024-11-29 22:22:49 +00:00 committed by Gerrit Code Review
commit 30ec05b01b
7 changed files with 36 additions and 14 deletions

View File

@ -43,12 +43,14 @@ class PatchAudit(object):
return PatchAuditData()
def subcloud_patch_audit(self, keystone_client, subcloud):
LOG.info("Triggered patch audit for: %s." % subcloud.name)
# NOTE(nicodemos): Patch audit not supported for 24.09 subcloud
if subcloud.software_version == SW_VERSION:
return consts.SYNC_STATUS_NOT_AVAILABLE
# Log this just for N-1 subclouds, before the has_usm_service external call
LOG.info("Triggered patch audit for: %s." % subcloud.name)
# NOTE(nicodemos): If the subcloud is on the 22.12 release with USM enabled,
# skip the patch audit.
if utils.has_usm_service(subcloud.region_name, keystone_client):

View File

@ -608,7 +608,7 @@ class SubcloudAuditManager(manager.Manager):
software_audit_data,
use_cache,
)
LOG.debug(
LOG.info(
"Sent subcloud audit request message for subclouds: %s"
% subcloud_ids
)
@ -626,7 +626,7 @@ class SubcloudAuditManager(manager.Manager):
software_audit_data,
use_cache,
)
LOG.debug(
LOG.info(
"Sent final subcloud audit request message for subclouds: %s"
% subcloud_ids
)

View File

@ -115,7 +115,7 @@ class IdentitySyncThread(SyncThread):
self.log_extra = {
"instance": "{}/{}: ".format(self.region_name, self.endpoint_type)
}
LOG.info("IdentitySyncThread initialized", extra=self.log_extra)
LOG.debug("IdentitySyncThread initialized", extra=self.log_extra)
def initialize_sc_clients(self):
super().initialize_sc_clients()

View File

@ -101,7 +101,7 @@ class SysinvSyncThread(SyncThread):
self.sc_sysinv_client = None
LOG.info("SysinvSyncThread initialized", extra=self.log_extra)
LOG.debug("SysinvSyncThread initialized", extra=self.log_extra)
def initialize_sc_clients(self):
super().initialize_sc_clients()

View File

@ -769,17 +769,18 @@ class SyncThread(object):
# shouldn't get here
LOG.exception("Unexpected error!")
if not total_num_of_audit_jobs:
if total_num_of_audit_jobs == 0:
# todo: if we had an "unable to sync this
# subcloud/endpoint" alarm raised, then clear it
pass
else:
db_api.subcloud_sync_update(
self.ctxt,
self.subcloud_name,
self.endpoint_type,
values={"sync_request": consts.SYNC_STATUS_REQUESTED},
)
db_api.subcloud_sync_update(
self.ctxt,
self.subcloud_name,
self.endpoint_type,
values={"sync_request": consts.SYNC_STATUS_REQUESTED},
)
LOG.debug(
"{}: done sync audit".format(threading.currentThread().getName()),
extra=self.log_extra,

View File

@ -594,7 +594,7 @@ class TestIdentitySyncThreadProjectRoleAssignmentsPut(
self._execute()
self._assert_log("info", "IdentitySyncThread initialized")
self._assert_log("debug", "IdentitySyncThread initialized")
self.log.error.assert_not_called()

View File

@ -1,4 +1,23 @@
/var/log/dcmanager/*.log
/var/log/dcmanager/state.log
{
nodateext
size 40M
start 1
rotate 20
missingok
notifempty
compress
sharedscripts
postrotate
systemctl reload syslog-ng > /dev/null 2>&1 || true
endscript
}
/var/log/dcmanager/audit.log
/var/log/dcmanager/dcmanager-api.log
/var/log/dcmanager/dcmanager.log
/var/log/dcmanager/orchestrator.log
{
nodateext
size 20M