You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2014/05/26 16:24:26 UTC
git commit: AMBARI-5895. Suppress any debug and info messages from
package managers in setupAgent.py (dlysnichenko)
Repository: ambari
Updated Branches:
refs/heads/trunk bed137b78 -> fe12ebc04
AMBARI-5895. Suppress any debug and info messages from package managers in setupAgent.py (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fe12ebc0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fe12ebc0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fe12ebc0
Branch: refs/heads/trunk
Commit: fe12ebc04b849b8340b9bd46ced0ac0aca579114
Parents: bed137b
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon May 26 17:23:31 2014 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon May 26 17:24:14 2014 +0300
----------------------------------------------------------------------
ambari-server/src/main/python/setupAgent.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/fe12ebc0/ambari-server/src/main/python/setupAgent.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/setupAgent.py b/ambari-server/src/main/python/setupAgent.py
index c7db372..28651e7 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -104,16 +104,16 @@ def findNearestAgentPackageVersion(projectVersion):
if projectVersion == "":
projectVersion = " "
if OSCheck.is_suse_family():
- Command = ["bash", "-c", "zypper search -s --match-exact ambari-agent | grep '" + projectVersion +
+ Command = ["bash", "-c", "zypper -q search -s --match-exact ambari-agent | grep '" + projectVersion +
"' | cut -d '|' -f 4 | head -n1 | sed -e 's/-\w[^:]*//1' "]
elif OSCheck.is_debian_family():
if projectVersion == " ":
- Command = ["bash", "-c", "apt-cache show ambari-agent |grep 'Version\:'|cut -d ' ' -f 2|tr -d '\\n'|sed -s 's/[-|~][A-Za-z\d]*//'"]
+ Command = ["bash", "-c", "apt-cache -q show ambari-agent |grep 'Version\:'|cut -d ' ' -f 2|tr -d '\\n'|sed -s 's/[-|~][A-Za-z0-9]*//'"]
else:
- Command = ["bash", "-c", "apt-cache show ambari-agent |grep 'Version\:'|cut -d ' ' -f 2|grep '" +
+ Command = ["bash", "-c", "apt-cache -q show ambari-agent |grep 'Version\:'|cut -d ' ' -f 2|grep '" +
projectVersion + "'|tr -d '\\n'|sed -s 's/[-|~][A-Za-z\d]*//'"]
else:
- Command = ["bash", "-c", "yum list all ambari-agent | grep '" + projectVersion +
+ Command = ["bash", "-c", "yum -q list all ambari-agent | grep '" + projectVersion +
"' | sed -re 's/\s+/ /g' | cut -d ' ' -f 2 | head -n1 | sed -e 's/-\w[^:]*//1' "]
return execOsCommand(Command)
@@ -133,13 +133,13 @@ def isAgentPackageAlreadyInstalled(projectVersion):
def getAvaliableAgentPackageVersions():
if OSCheck.is_suse_family():
Command = ["bash", "-c",
- "zypper search -s --match-exact ambari-agent | grep ambari-agent | sed -re 's/\s+/ /g' | cut -d '|' -f 4 | tr '\\n' ', ' | sed -s 's/[-|~][A-Za-z\d]*//g'"]
+ "zypper -q search -s --match-exact ambari-agent | grep ambari-agent | sed -re 's/\s+/ /g' | cut -d '|' -f 4 | tr '\\n' ', ' | sed -s 's/[-|~][A-Za-z0-9]*//g'"]
elif OSCheck.is_debian_family():
Command = ["bash", "-c",
- "apt-cache show ambari-agent|grep 'Version\:'|cut -d ' ' -f 2| tr '\\n' ', '|sed -s 's/[-|~][A-Za-z\d]*//g'"]
+ "apt-cache -q show ambari-agent|grep 'Version\:'|cut -d ' ' -f 2| tr '\\n' ', '|sed -s 's/[-|~][A-Za-z0-9]*//g'"]
else:
Command = ["bash", "-c",
- "yum list all ambari-agent | grep -E '^ambari-agent' | sed -re 's/\s+/ /g' | cut -d ' ' -f 2 | tr '\\n' ', ' | sed -s 's/[-|~][A-Za-z\d]*//g'"]
+ "yum -q list all ambari-agent | grep -E '^ambari-agent' | sed -re 's/\s+/ /g' | cut -d ' ' -f 2 | tr '\\n' ', ' | sed -s 's/[-|~][A-Za-z0-9]*//g'"]
return execOsCommand(Command)
@@ -152,8 +152,8 @@ def checkServerReachability(host, port):
except Exception:
ret["exitstatus"] = 1
ret["log"] = "Host registration aborted. Ambari Agent host cannot reach Ambari Server '" +\
- host+":"+str(port) + "'. "+\
- "Please check the network connectivity between the Ambari Agent host and the Ambari Server"
+ host+":"+str(port) + "'. " +\
+ "Please check the network connectivity between the Ambari Agent host and the Ambari Server"
sys.exit(ret)
pass