]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Replace some verbose print()s by logprint_with_config()
authorAxel Beckert <abe@deuxchevaux.org>
Wed, 28 Nov 2012 00:10:58 +0000 (01:10 +0100)
committerAxel Beckert <abe@deuxchevaux.org>
Wed, 28 Nov 2012 00:10:58 +0000 (01:10 +0100)
lib/Xen/Tools/Common.pm

index 5d5eeda3a7ef771474edfb4176ee4ab24000f770..df113821735e00138ec26e5d350b2992357e516f 100644 (file)
@@ -230,7 +230,9 @@ sub runCommand ($$)
     #
     #  Header.
     #
-    $CONFIG->{ 'verbose' } && print "Executing : $cmd\n";
+    if ($CONFIG->{ 'verbose' }) {
+        logprint_with_config("Executing : $cmd\n", $CONFIG);
+    }
 
     #
     #  Copy stderr to stdout, so we can see it, and make sure we log it.
@@ -259,7 +261,9 @@ sub runCommand ($$)
 
     my $rcclose = close(CMD);
 
-    $CONFIG->{ 'verbose' } && print "Finished : $cmd\n";
+    if ($CONFIG->{ 'verbose' }) {
+        logprint_with_config("Finished : $cmd\n", $CONFIG);
+    }
 
     if (!$rcclose)
     {
@@ -327,14 +331,18 @@ sub setupAdminUsers ($)
         {
 
             # Change shell.
-            $CONFIG->{ 'verbose' } && print "Changing shell for $user: $shell\n";
+            if ($CONFIG->{ 'verbose' }) {
+                logprint_with_config("Changing shell for $user: $shell\n", $CONFIG);
+            }
             system( "chsh", "-s", $shell, $user );
         }
         else
         {
 
             # Add a new user.
-            $CONFIG->{ 'verbose' } && print "Adding new user: $user\n";
+            if ($CONFIG->{ 'verbose' }) {
+                logprint_with_config("Adding new user: $user\n", $CONFIG);
+            }
             system( "useradd", "-s", $shell, $user );
         }