aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2020-04-16 10:18:39 -0400
committerJake Hunsaker <jhunsake@redhat.com>2020-04-22 10:58:15 -0400
commit0a9ee64550acfc3e792d5b6a9529c866fb833ba5 (patch)
tree70d59f1ed648d385cb62620caf43cae1a3644b48
parent2d5d7fa3e675950708869e5e646298a6bcc7b2b2 (diff)
downloadsos-0a9ee64550acfc3e792d5b6a9529c866fb833ba5.tar.gz
[collector] Properly remove localhost if local sudo is needed but missing
Fixes an issue where we would still attempt to run through local sos report setup if we need sudo but the password was not given. This final catch is done right before sosreport is called on connected nodes, so it will catch any future conditions where no_local gets set after the initial configuration check. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/collector/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py
index 78f087c4..2c2d4027 100644
--- a/sos/collector/__init__.py
+++ b/sos/collector/__init__.py
@@ -973,9 +973,11 @@ this utility or remote systems that it connects to.
pool.map(self._connect_to_node, nodes, chunksize=1)
pool.shutdown(wait=True)
+ if (self.opts.no_local and
+ self.client_list[0].address == 'localhost'):
+ self.client_list.pop(0)
+
self.report_num = len(self.client_list)
- if self.opts.no_local and self.master.address == 'localhost':
- self.report_num -= 1
if self.report_num == 0:
self.exit("No nodes connected. Aborting...")