diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2021-09-30 10:57:38 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2021-09-30 20:58:07 -0400 |
commit | 691f6950f9bdd8f7fc464aa4f83765fef47e2f6b (patch) | |
tree | a7d9ecb426c0db52752e5c5adb86188c3c844f39 | |
parent | 7d5157aa5071e3620246e2d4aa80acb2d3ed30f0 (diff) | |
download | sos-691f6950f9bdd8f7fc464aa4f83765fef47e2f6b.tar.gz |
[Policy] Fix assignment of case id prompt
When prompting for a case id, `Policy` was not properly updating the
option value, only assigning the value to `Policy` which meant that
aspects outside of `Policy` could not always properly reference the
(updated) case id.
Fix this by assigning the case id prompt response back to the case_id
option value. `Policy` still retains a local reference to case_id as
existing logic was setting that based on the (assumed-to-be-updated)
option value, which until this commit would have been superfluous.
Closes: #2707
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/policies/distros/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sos/policies/distros/__init__.py b/sos/policies/distros/__init__.py index c33a356a..0906fa77 100644 --- a/sos/policies/distros/__init__.py +++ b/sos/policies/distros/__init__.py @@ -219,11 +219,12 @@ class LinuxPolicy(Policy): cmdline_opts.quiet: try: if caseid: - self.case_id = caseid + self.commons['cmdlineopts'].case_id = caseid else: - self.case_id = input(_("Optionally, please enter the case " - "id that you are generating this " - "report for [%s]: ") % caseid) + self.commons['cmdlineopts'].case_id = input( + _("Optionally, please enter the case id that you are " + "generating this report for [%s]: ") % caseid + ) # Policies will need to handle the prompts for user information if cmdline_opts.upload and self.get_upload_url(): self.prompt_for_upload_user() |