spacecmd --debug shows password in plaintext, obfuscate with asterisks so that
--debug can be used while colleagues are watching :)
---
 spacecmd/src/lib/misc.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 0587ad1..bab51e6 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -917,6 +917,11 @@ def load_config_section(self, section):
         else:
             self.config['nossl'] = False
 
-    logging.debug('Current Configuration: %s' % self.config)
+    # Obfuscate the password with asterisks
+    config_debug = self.config.copy()
+    if config_debug.has_key('password'):
+        config_debug['password'] = "*" * len(config_debug['password'])
+
+    logging.debug('Current Configuration: %s' % config_debug)
 
 # vim:ts=4:expandtab:
-- 
1.7.1

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to