incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dax Kelson (JIRA)" <>
Subject [jira] [Created] (AMBARI-2984) RPM has direct query mode, should use it instead of needless pipe to grep
Date Thu, 22 Aug 2013 00:08:51 GMT
Dax Kelson created AMBARI-2984:

             Summary: RPM has direct query mode, should use it instead of needless
pipe to grep
                 Key: AMBARI-2984
             Project: Ambari
          Issue Type: Improvement
            Reporter: Dax Kelson
            Priority: Minor

Here is my patch

From: Dax Kelson <>
Date: Wed, 21 Aug 2013 17:59:15 -0600
Subject: [PATCH] Improved RPM query for sudo

No need to run "rpm -qa | grep sudo" when
"rpm -q sudo" works much faster and efficiently.

$ time rpm -qa | grep sudo

real	0m0.537s
user	0m0.323s
sys	0m0.161s

$ time rpm -q sudo

real	0m0.010s
user	0m0.009s
sys	0m0.000s
 ambari-server/src/main/python/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-server/src/main/python/ b/ambari-server/src/main/python/
index f83739b..b4bcdd2 100755
--- a/ambari-server/src/main/python/
+++ b/ambari-server/src/main/python/
@@ -549,7 +549,7 @@ class BootStrap:
   def checkSudoPackage(self):
       """ Checking 'sudo' package on remote hosts """
-      command = "rpm -qa | grep sudo"
+      command = "rpm -q sudo"
       pssh = PSSH(self.successive_hostlist, self.user, self.sshkeyFile, self.bootdir,\
                   errorMessage="Error: Sudo command is not available. Please install the
sudo command.",\

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message