Continued Troubleshooting cases where HTML has empty table

This commit is contained in:
=
2025-08-22 13:18:52 -04:00
parent ae97d04097
commit e2398c687b
+17 -19
View File
@@ -92,16 +92,13 @@ def menu_feature2():
print("Invalid choice. Please try again.")
def menu_prepare_to_enforce():
first_policy = ["",""]
second_policy = ["",""]
policylist = first_policy[1]
history_pol1_staged = False
history_pol2_staged = False
history_staged = False
hashes_threat_pulled = False
hashes_categorized = False
path_exclusions_calculated = False
allowed_paths_determined = False
history_pol1_staged = True
history_pol2_staged = True
history_staged = True
hashes_threat_pulled = True
hashes_categorized = True
path_exclusions_calculated = True
allowed_paths_determined = True
df_aggregated_combo = pd.DataFrame()
while True:
@@ -121,23 +118,24 @@ def menu_prepare_to_enforce():
choice = input("Enter your choice: ")
if choice == "1":
first_policy = utils.allowlist.listPolicies(url)
first_policy_tuple = utils.allowlist.listPolicies(url)
first_policy = first_policy_tuple[1][first_policy_tuple[0]]
elif choice == "2":
second_policy = utils.allowlist.listPolicies(url)
second_policy_tuple = utils.allowlist.listPolicies(url)
second_policy = second_policy_tuple[1][second_policy_tuple[0]]
elif choice == "3":
executionhist_policy1 = utils.allowlist.pullPolicyExechistories(url,first_policy, first_policy,True)
executionhist_policy1 = utils.allowlist.pullPolicyExechistories(url,first_policy_tuple[0], first_policy_tuple[1],True)
df_aggregated_policy1 = utils.hashfunctions.aggregateHashes(executionhist_policy1)
df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2)
df_aggregated_combo= pd.concat([df_aggregated_policy1, df_aggregated_policy2], ignore_index=True)
df_aggregated_combo.to_html(f"df_aggregated_combo_{first_policy[1][first_policy[0]]}_{second_policy[1][second_policy[0]]}.html", index=False)
history_staged = True
df_aggregated_policy1.to_html(f"df_aggregated_{first_policy}.html", index=False)
history_pol1_staged =True
elif choice == "4":
executionhist_policy2 = utils.allowlist.pullPolicyExechistories(url,second_policy, second_policy,True)
executionhist_policy2 = utils.allowlist.pullPolicyExechistories(url,second_policy_tuple[0], second_policy_tuple[1],True)
df_aggregated_policy2 = utils.hashfunctions.aggregateHashes(executionhist_policy2)
df_aggregated_policy2.to_html(f"df_aggregated_{second_policy}.html")
df_aggregated_policy2.to_html(f"df_aggregated_{second_policy}.html", index=False)
history_pol2_staged =True
elif choice == "5":