incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mahadev konar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-2984) RPM has direct query mode, bootstrap.py should use it instead of needless pipe to grep
Date Thu, 17 Oct 2013 22:25:42 GMT

     [ 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.1)
                   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
>             Fix For: 1.4.2
>
>
> Here is my patch
> From: Dax Kelson <dkelson@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#6144)

Mime
View raw message