minor fix
This commit is contained in:
1 parent
fd11784744
commit
99ca593c06
2 files changed
+5
-4
No files matched your search
+4
-2
@@ -77,7 +77,8 @@ def grep_all_ips(ips, cmd, if_unit_test):
|
||||
cmd = ["grep", *[arg for arg in sys.argv[1:] if arg != "-t"]]
|
||||
#track time
|
||||
start_time = time.perf_counter()
|
||||
match_count = grep_all_ips(ALL_IPS, cmd, if_unit_test=[x for x in sys.argv].count("-t") > 0)
|
||||
is_unit_test = "-t" in sys.argv
|
||||
match_count = grep_all_ips(ALL_IPS, cmd, if_unit_test=is_unit_test)
|
||||
end_time = time.perf_counter()
|
||||
|
||||
print("=========================== SUMMARY ===========================")
|
||||
@@ -92,6 +93,7 @@ for i, count in enumerate(match_count):
|
||||
print(f"machine.{i + 1}.test.log: {count} matches")
|
||||
else:
|
||||
print(f"machine.{i + 1}.log: {count} matches")
|
||||
print(f"Total matches: {max(0, sum(match_count))}")
|
||||
total_matches = sum(count for count in match_count if count > 0)
|
||||
print(f"Total matches: {total_matches}")
|
||||
print("===============================================================")
|
||||
print(f"Time taken: {end_time - start_time:.2f} seconds")
|
||||
+1
-2
@@ -59,8 +59,7 @@ while True:
|
||||
send_message(conn, result.stdout + result.stderr)
|
||||
|
||||
except Exception as e:
|
||||
error_message = f"Error executing command: {e}"
|
||||
send_message(conn, error_message)
|
||||
None
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
|
||||
Reference in new issue
Block a user