-
Notifications
You must be signed in to change notification settings - Fork 543
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
[juju][collect] Fix new juju collection #3400
[juju][collect] Fix new juju collection #3400
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
1 similar comment
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
9e7bc4a
to
90bfcff
Compare
/packit rebuild-failed |
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.
LGTM.
We're trying to push f-strings, but here it'd be a bit awkward without re-writing the entire command slicing, so we'll put this one on the back burner for another time.
As an aside, I can't imagine we're the only ones calling juju
so it may be worth working with the juju devs to automatically detect when to use --no-color
from the juju
command for situations like this (e.g. when not called from a shell).
sos/collector/clusters/juju.py
Outdated
cmd = "juju version" | ||
res = sos_get_command_output(cmd) |
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 not single
res = sos_get_command_output("juju version")
?
(or maybe even merge it with return
, though that might sacrifice code readability too much)
Actually, I didn't think too much of it, and I think that is valid point. So, I have opened a bug on our end. I think, at this point, I'm on the opinion that I would put this as a draft/wip, until we are 100%, and if it does get fixed in |
So, after discussing this, and update on the bug, https://bugs.launchpad.net/juju/+bug/2042309, the reason why we are getting colorise is due to the fact we are allocating PTY. Is there a way we can avoid this, and then we don't need to force the res = self.primary.run_command(cmd, get_pty=pty, need_root=need_root,
timeout=timeout) |
IIRC, that is due to the default usage of On that note, it's weird that we're setting this in a I think the best approach here is to remove the I'm happy to move bits around on this (though likely in a few days as day job has me tied up for the week), but if you'd like to handle it within this or another PR, that's fine too, just let me know. |
The `get_pty` parameter for remote executed commands was both a bit of a misnomer and applied too broadly. Refactor this to `use_shell` to be more obvious about what the intent behind the option is, and default all transports to `False`, so that by default we do not wrap any commands in a bash shell. This may be overriden on a per-transport basis via the ned `_need_shell` property within transport subclasses. Further, this facility has been expanded to be allowed on a per-command basis from `SoSNode.run_command()` and wherever that is linked. Related: sosreport#3399 Related: sosreport#3400 Signed-off-by: Jake Hunsaker <[email protected]>
The `get_pty` parameter for remote executed commands was both a bit of a misnomer and applied too broadly. Refactor this to `use_shell` to be more obvious about what the intent behind the option is, and default all transports to `False`, so that by default we do not wrap any commands in a bash shell. This may be overriden on a per-transport basis via the ned `_need_shell` property within transport subclasses. Further, this facility has been expanded to be allowed on a per-command basis from `SoSNode.run_command()` and wherever that is linked. Related: #3399 Related: #3400 Signed-off-by: Jake Hunsaker <[email protected]>
90bfcff
to
daba16c
Compare
/packit rebuild-failed |
New version of juju uses colorisation, and therefore juju status and json.loads doesn't load the juju status correctly. By using --no-color based on the version of juju this should fix this particular use-case Resolves: sosreport#3399 Resolves: SET-339 Signed-off-by: Arif Ali <[email protected]>
daba16c
to
d511bb6
Compare
New version of juju uses colorisation, and therefore juju status and json.loads doesn't load the juju status correctly. By using --no-color based on the version of juju this should this particular use-case
Resolves: #3399
Resolves: SET-339
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines