Skip to content

Commit 35b4c4c

Browse files
committed
Fix logging and improve reason text
1 parent dfb2818 commit 35b4c4c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

nxc/modules/wcc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def check_registry(self, *specs, options=None, stop_on_error=False):
278278
reasons = ["Check could not be performed (invalid specification provided)"]
279279
return ok, reasons
280280
except Exception as e:
281-
self.module.log.error(f"Check could not be performed. Details: specs={specs}, dce={self.dce}, error: {e}")
281+
self.context.log.error(f"Check could not be performed. Details: specs={specs}, dce={self.dce}, error: {e}")
282282
return ok, reasons
283283

284284
if op == operator.eq:
@@ -512,7 +512,7 @@ def check_defender_exclusion(self, *spec, options=None):
512512
reasons = ["Check could not be performed (invalid specification provided)"]
513513
return ok, reasons
514514
except Exception as e:
515-
ok, reasons = self.module.log.error(f"Check could not be performed. Details: spec={spec}, dce={self.dce}, error: {e}")
515+
self.context.log.error(f"Check could not be performed. Details: spec={spec}, dce={self.dce}, error: {e}")
516516
return ok, reasons
517517

518518
reasons = []
@@ -521,7 +521,7 @@ def check_defender_exclusion(self, *spec, options=None):
521521
count, exclusions_p = self.get_exclusions(policy_key_name)
522522
reasons = [f"Policy: [{', '.join(exclusions_p)}]"]
523523
count_k, exclusions_k = self.get_exclusions(key_name)
524-
reasons.append(f"Specific: [{', '.join(exclusions_k)}]")
524+
reasons.append(f"Manual: [{', '.join(exclusions_k)}]")
525525
count += count_k
526526

527527
if count > 0:

0 commit comments

Comments
 (0)