-
Notifications
You must be signed in to change notification settings - Fork 544
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
[Plugin] Standardize directory listings with new method #3664
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,11 +35,9 @@ def setup(self): | |
"/etc/ansible-automation-platform/gateway/*.cert", | ||
]) | ||
|
||
self.add_cmd_output([ | ||
"aap-gateway-manage list_services", | ||
"ls -ll /etc/ansible-automation-platform/", | ||
"ls -ll /etc/ansible-automation-platform/gateway/", | ||
]) | ||
self.add_cmd_output("aap-gateway-manage list_services") | ||
self.add_dir_listing("/etc/ansible-automation-platform/", | ||
recursive=True) | ||
Comment on lines
+38
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will additionally collect all recursive subdirs of |
||
|
||
def postproc(self): | ||
# remove database password | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,8 +52,8 @@ def setup(self): | |
timeout=30 | ||
) | ||
|
||
for _dir in ["/etc/rhsm", "/sys/kernel", "/var/lib/sss"]: | ||
self.add_cmd_output(f"/bin/ls -lanR {_dir}", cmd_as_tag=True) | ||
self.add_dir_listing(["/etc/rhsm", "/sys/kernel", "/var/lib/sss"], | ||
recursive=True) | ||
Comment on lines
+55
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We stop adding tags here. Also not sure if I am checking this internally.. |
||
|
||
def postproc(self): | ||
for conf in self.config_and_status: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,9 @@ def setup(self): | |
dirs.add(fqlib[1].rsplit('/', 1)[0]) | ||
|
||
if dirs: | ||
self.add_cmd_output(f"ls -lanH {' '.join(dirs)}", | ||
suggest_filename="ld_so_cache") | ||
self.add_dir_listing( | ||
f"{' '.join(dirs)}", | ||
suggest_filename='ld_so_cache' | ||
) | ||
Comment on lines
-47
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# vim: set et ts=4 sw=4 : |
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.
Missing
recursive=False
?(should
recursive
have default valueTrue
orFalse
? I would expectFalse
since that follows defaultls
behaviour and I would expect it as a human-default thinking of "list directory" as well; also since the patch replaces 38 instances of recursive listings and 32 non-recursive ones, there is no need to have such strong preference to the "recursive is far more used default")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.
When I was first reviewing the PR I was thinking the same, and missed the
recursive=True
as the default in the function definition, and had put in ~10 comments before abandoning it. I would agree with @pmoravec here, I think havingrecursive=False
should be default and we userecursive=True
where needed