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
[gluster_block] Added new plugin gluster_block #1041
Conversation
In future please fill out the pull request template - it is there to save everyone time (including you, by avoiding unnecessary requests to respin the branch). |
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.
This should be a very short and simple plugin: just detect the presence of gluster_block
and collect the logs. Nothing more.
Duplicating the targetcli
plugin functionality is not acceptable - once all that is removed we can merge the rest as a simple log collector for the block service.
sos/plugins/gluster_block.py
Outdated
plugin_name = 'gluster_block' | ||
profiles = ('storage',) | ||
packages = ["gluster-block"] | ||
files = ["/usr/sbin/gluster-block"] |
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.
Why lists for these? The normal sos
style is to use a tuple (since they are invariant and do not need the baggage of a mutable list type).
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.
ok. I am changing lists to tuples.
sos/plugins/gluster_block.py
Outdated
config_to_collect = ["/sys/kernel/config/target", "/etc/target"] | ||
|
||
def setup(self): | ||
self.add_cmd_output("targetcli ls") |
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.
Nack. We have the targetcli
plugin for that.
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.
Sure. removed this cmd.
sos/plugins/gluster_block.py
Outdated
|
||
# collect config files | ||
for config_file in self.config_to_collect: | ||
self.add_copy_spec(config_file) |
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.
Nack. Please look at the API documentation. The add_copy_spec()
method accepts either a single string, or a list of strings. This is just pointless make-work.
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.
ok, will collect only "/sys/kernel/config/target" which is not being collected by targetcli.
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.
It needs to go into the targetcli
plugin - you can either file a separate pull request for that, or just amend your existing commit (to address the review items), and then add a new commit with the change for targetcli
. Once that's done you can update the branch for the PR with git push --force
.
Note that we don't accept 'fixup' commits in master so you'll need to respin the branch anyway for the review items.
limit = self.get_option("log_size") | ||
else: | ||
limit = 0 | ||
|
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.
Ack, thanks for implementing log limiting.
limit = 0 | ||
|
||
if limit: | ||
for f in glob.glob("/var/log/gluster-block/*.log"): |
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.
Ack. This is ugly, but it is in keeping with other plugins that try to work around the current limits API shortcomings. We can clean it up later when those are addressed.
sos/plugins/gluster_block.py
Outdated
profiles = ('storage',) | ||
packages = ["gluster-block"] | ||
files = ["/usr/sbin/gluster-block"] | ||
config_to_collect = ["/sys/kernel/config/target", "/etc/target"] |
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.
Nack: you're just duplicating the targetcli
plugin under a different name!
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.
Didnt observed the targetcli plugin, I will remove targetcli from gluster-block plugin.
I changed the code in latest commit. please review the latest changes. |
Please don't push fixup commits ( Use |
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.
Need to remove targetcli
change - can either move it to targetcli
in this PR, or start a new one - I don't mind, but it does not belong in this plugin.
Once that change is done & the extra commit folded back into the original this should be ready for merge.
sos/plugins/gluster_block.py
Outdated
for config_file in self.config_to_collect: | ||
self.add_copy_spec(config_file) | ||
# collect config | ||
self.add_copy_spec("/sys/kernel/config/target") |
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.
As discussed, this needs to go in the targetcli
plugin.
sos/plugins/gluster_block.py
Outdated
@@ -43,3 +40,4 @@ def setup(self): | |||
self.add_copy_spec(f, limit) | |||
else: | |||
self.add_copy_spec("/var/log/gluster-block") | |||
|
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.
Other than the remaining targetcli
line these changes look fine, once they are folded into the original commit and the branch updated.
1cd8706
to
0028b5f
Compare
Sorry for too many updates. I am contributing to sos report for 1st time. I made code changes according to guidelines and submitted new commit. the new commit also has target cli changes in targetcli plugin only. so gluster block plugin only collects logs related to it. |
can you please review my latest commit. I incorporated all the comments. |
You should either note that It's obfuscating to hide a change to another plugin inside a commit that say "add a new plugin"; it's potentially confusing for people reading the logs and trying to track down changes. The point is to make it easy for folks reviewing for changes, or filtering commits by affected plugins. |
gluster_block plugin collects config/log files related to blocks Signed-off-by: venkata edara <redara@redhat.com>
0028b5f
to
66e11ab
Compare
I migrated all changes of targetcli to other commit of branch
"target-cli-collect-kernel-config". I created new pull request for
targetcli separately.
gluster-block-plugin has only gluster-block changes.
Let me know if the commit changes are good.
…-Venkat
On 06/27/2017 05:32 PM, Bryn M. Reeves wrote:
You should either note that |targetcli| change in the commit message
or (better, but I won't insist on it), in a separate commit (although
technically, to comply with our commit formatting, you'd then need to
have a subject of |[targetcli, gluster_block] add new plugin and one
item to targetcli|, which just looks weird..).
It's obfuscating to hide a change to another plugin inside a commit
that say "add a new plugin"; it's potentially confusing for people
reading the logs and trying to track down changes.
The point is to make it easy for folks reviewing for changes, or
filtering commits by affected plugins.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1041 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYE71nQ-u3XFSQoP0MM9YJADRyxBD_tTks5sIO9ygaJpZM4N91UR>.
|
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.
ack
Looks good, thanks for re-working. 👍 |
gluster_block plugin collects config and log files related to blocks
Signed-off-by: venkata edara redara@redhat.com
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines