-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove newlines #675
Remove newlines #675
Conversation
tavern/tomes/ifconfig/main.eldritch
Outdated
for i, c in enumerate(r): | ||
row.append(rpad(c, counts[i]+2)) | ||
print("".join(row)) | ||
|
||
def ifconfig(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename the tome from ifconfig to something less loaded like get_net_info
or network_recon
Then in the future if we have other net info like trace route we can include it here as well.
@@ -216,13 +216,12 @@ def persist_service(service_name, service_desc, executable_name, executable_url) | |||
executable_path = "/var/root/"+executable_name | |||
launch_daemon(service_name, executable_path, executable_url) | |||
else: | |||
print("OS not supported\n") | |||
print("OS not supported") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to eprint
|
||
for proc in procs: | ||
rows = [["PID", "PPID", "USER","COMMAND"]] | ||
for proc in sorted(procs, key=lambda x:x["pid"]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting by PID? smh - if possible we should sort by spawn time (which i think is the default unsure thogh)
str(proc['pid']), | ||
str(proc['ppid']), | ||
proc['username'], | ||
current_proc_command.replace("\n","\\n")[:80] # trim absurdly long cmds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not trim the command - in tavern we don't wrap so it won't look gross.
But if we avoid truncating that's more searchable fields.
Good for situations like REALLY long java commands with a "PASSWORD" arg.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #675 +/- ##
==========================================
+ Coverage 71.76% 72.03% +0.27%
==========================================
Files 175 175
Lines 12111 12219 +108
==========================================
+ Hits 8691 8802 +111
+ Misses 3205 3202 -3
Partials 215 215 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all excess newlines from tomes
remove redundant tomes (hostname and get_net_info)
clean up table printing on a few tomes