Skip to content

Commit 772425d

Browse files
DR-941 Skip unknown, inactive, or missing content vertices.
In the job detail, some vertices may no longer exist, are inactive, or missing content. Skip these with printing out information.
1 parent d096027 commit 772425d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

keepercommander/commands/discover/job_status.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22
import argparse
33
import json
4+
import logging
45
from . import PAMGatewayActionDiscoverCommandBase, GatewayContext
56
from ... import vault_extensions
67
from ...display import bcolors
@@ -188,13 +189,19 @@ def print_job_detail(params, gateway_context, jobs, job_id):
188189
print(f"{_h('Added')} - {len(delta.added)} count")
189190
for item in delta.added:
190191
vertex = infra.dag.get_vertex(item.uid)
192+
if vertex is None or vertex.active is False or vertex.has_data is False:
193+
logging.debug("added: vertex is none, inactive or has no data")
194+
continue
191195
discovery_object = DiscoveryObject.get_discovery_object(vertex)
192196
print(f" * {discovery_object.description}")
193197

194198
print("")
195199
print(f"{_h('Changed')} - {len(delta.changed)} count")
196200
for item in delta.changed:
197201
vertex = infra.dag.get_vertex(item.uid)
202+
if vertex is None or vertex.active is False or vertex.has_data is False:
203+
logging.debug("changed: vertex is none, inactive or has no data")
204+
continue
198205
discovery_object = DiscoveryObject.get_discovery_object(vertex)
199206
print(f" * {discovery_object.description}")
200207
if item.changes is None:

0 commit comments

Comments
 (0)