Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions keepercommander/commands/discover/result_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class PAMGatewayActionDiscoverResultProcessCommand(PAMGatewayActionDiscoverComma
help='Discovery job to process.')
parser.add_argument('--add-all', required=False, dest='add_all', action='store_true',
help='Respond with ADD for all prompts.')
parser.add_argument('--rules-only', required=False, dest='rules_only', action='store_true',
help='Auto-process with rules without manual prompts.')
parser.add_argument('--preview', required=False, dest='do_preview', action='store_true',
help='Preview the results')
parser.add_argument('--debug-gs-level', required=False, dest='debug_level', action='store',
Expand Down Expand Up @@ -1466,6 +1468,7 @@ def execute(self, params: KeeperParams, **kwargs):
do_preview = kwargs.get("do_preview", False)
job_id = kwargs.get("job_id")
add_all = kwargs.get("add_all", False)
rules_only = kwargs.get("rules_only", False)
debug_level = kwargs.get("debug_level", 0)

all_gateways = GatewayContext.all_gateways(params)
Expand Down Expand Up @@ -1554,6 +1557,9 @@ def execute(self, params: KeeperParams, **kwargs):

# Pass method that will display auto added records.
auto_add_result_func=self._display_auto_add_results,

# Process rules with no prompts.
rules_only=rules_only,

# Provides a cache of the record key to record UID.
record_cache=record_cache,
Expand All @@ -1567,6 +1573,7 @@ def execute(self, params: KeeperParams, **kwargs):
"add_all": add_all
}
)
return

logging.debug(f"Results: {results}")

Expand Down
32 changes: 17 additions & 15 deletions keepercommander/discovery_common/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@ def run(self,
prompt_confirm_add_func: Optional[Callable] = None,
prompt_admin_func: Optional[Callable] = None,
auto_add_result_func: Optional[Callable] = None,
rules_only: bool = False,
directory_info_func: Optional[Callable] = None,
context: Optional[Any] = None,
record_cache: Optional[dict] = None,
Expand Down Expand Up @@ -1473,21 +1474,22 @@ def run(self,
# This is the total number of items that processing needs to process.
# We start with items_left equal to item_count.
item_count = self._get_count(configuration)

self._process_level(
current_vertex=configuration,
bulk_add_records=bulk_add_records,
bulk_convert_records=bulk_convert_records,
record_lookup_func=record_lookup_func,
prompt_func=prompt_func,
prompt_admin_func=prompt_admin_func,
record_prepare_func=record_prepare_func,
directory_info_func=directory_info_func,
record_cache=record_cache,
indent=0,
item_count=item_count,
items_left=item_count,
context=context)

if rules_only is False:
self._process_level(
current_vertex=configuration,
bulk_add_records=bulk_add_records,
bulk_convert_records=bulk_convert_records,
record_lookup_func=record_lookup_func,
prompt_func=prompt_func,
prompt_admin_func=prompt_admin_func,
record_prepare_func=record_prepare_func,
directory_info_func=directory_info_func,
record_cache=record_cache,
indent=0,
item_count=item_count,
items_left=item_count,
context=context)

# This mainly for testing.
# If throw and quit exception, so we can prompt the user.
Expand Down
Loading