aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/collector/__init__.py7
-rw-r--r--sos/collector/sosnode.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py
index 26b146cc..e8757621 100644
--- a/sos/collector/__init__.py
+++ b/sos/collector/__init__.py
@@ -591,8 +591,9 @@ class SoSCollector(SoSComponent):
'nodes unless the --password option is provided.\n')
self.ui_log.info(self._fmt_msg(msg))
- if ((self.opts.password or self.opts.password_per_node) and not
- self.opts.batch):
+ if ((self.opts.password or (self.opts.password_per_node and
+ self.opts.master))
+ and not self.opts.batch):
self.log_debug('password specified, not using SSH keys')
msg = ('Provide the SSH password for user %s: '
% self.opts.ssh_user)
@@ -600,7 +601,7 @@ class SoSCollector(SoSComponent):
if ((self.commons['need_sudo'] and not self.opts.nopasswd_sudo)
and not self.opts.batch):
- if not self.opts.password:
+ if not self.opts.password and not self.opts.password_per_node:
self.log_debug('non-root user specified, will request '
'sudo password')
msg = ('A non-root user has been provided. Provide sudo '
diff --git a/sos/collector/sosnode.py b/sos/collector/sosnode.py
index 398db303..4fef90a8 100644
--- a/sos/collector/sosnode.py
+++ b/sos/collector/sosnode.py
@@ -37,6 +37,8 @@ class SosNode():
self.cluster = None
self.hostname = None
self._password = password or self.opts.password
+ if not self.opts.nopasswd_sudo and not self.opts.sudo_pw:
+ self.opts.sudo_pw = self._password
# override local sudo from any other source
if local_sudo:
self.opts.sudo_pw = local_sudo