]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding debug output
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 12 Jun 2020 12:00:45 +0000 (14:00 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 12 Jun 2020 12:00:45 +0000 (14:00 +0200)
lib/cr_vmware_tpl/config.py

index 683ae29aff899b376daea775f7fbdaf59aefc397..b4dea182fb4d4a604dbb752cbbba7d2def807ef5 100644 (file)
@@ -615,8 +615,12 @@ class CrTplConfiguration(BaseConfiguration):
             raise ValueError(msg)
 
         salt = crypt.mksalt(self.method_list[m])
-        LOG.debug("Hashing password {pw!r} with salt {sa!r} (method {me!r})..".format(
-            pw=self.root_password, sa=salt, me=m))
+        if self.verbose > 1:
+            pw_show = self.root_password
+            if self.verbose < 4:
+                pw_show = '********'
+            LOG.debug("Hashing password {pw!r} with salt {sa!r} (method {me!r})..".format(
+                pw=pw_show, sa=salt, me=m))
         pwd_hash = crypt.crypt(self.root_password, salt)
         if self.verbose > 2:
             LOG.debug(_("Hashed root password: {!r}").format(pwd_hash))