You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Mahadev konar (JIRA)" <ji...@apache.org> on 2013/12/18 04:38:07 UTC
[jira] [Updated] (AMBARI-2984) RPM has direct query mode,
bootstrap.py should use it instead of needless pipe to grep
[ https://issues.apache.org/jira/browse/AMBARI-2984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar updated AMBARI-2984:
----------------------------------
Fix Version/s: (was: 1.4.2)
> RPM has direct query mode, bootstrap.py should use it instead of needless pipe to grep
> --------------------------------------------------------------------------------------
>
> Key: AMBARI-2984
> URL: https://issues.apache.org/jira/browse/AMBARI-2984
> Project: Ambari
> Issue Type: Improvement
> Reporter: Dax Kelson
> Assignee: Dax Kelson
> Priority: Minor
> Labels: patch
>
> Here is my patch
> From: Dax Kelson <dk...@gurulabs.com>
> 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
> sudo-1.8.6p3-7.el6.x86_64
> real 0m0.537s
> user 0m0.323s
> sys 0m0.161s
> $ time rpm -q sudo
> sudo-1.8.6p3-7.el6.x86_64
> real 0m0.010s
> user 0m0.009s
> sys 0m0.000s
> ---
> ambari-server/src/main/python/bootstrap.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/ambari-server/src/main/python/bootstrap.py b/ambari-server/src/main/python/bootstrap.py
> index f83739b..b4bcdd2 100755
> --- a/ambari-server/src/main/python/bootstrap.py
> +++ b/ambari-server/src/main/python/bootstrap.py
> @@ -549,7 +549,7 @@ class BootStrap:
> def checkSudoPackage(self):
> try:
> """ 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.",\
> command=command)
> --
> 1.8.3.1
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)