Browse Source

AMBARI-6564. Rerunning bootstrap on Ubuntu after removing agent fails (aonishuk)

Andrew Onishuk 11 years ago
parent
commit
340afc1be0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ambari-server/src/main/python/setupAgent.py

+ 1 - 1
ambari-server/src/main/python/setupAgent.py

@@ -117,7 +117,7 @@ def findNearestAgentPackageVersion(projectVersion):
 
 def isAgentPackageAlreadyInstalled(projectVersion):
     if OSCheck.is_debian_family():
-      Command = ["bash", "-c", "dpkg -s ambari-agent  2>&1|grep 'Version\:'|grep " + projectVersion]
+      Command = ["bash", "-c", "dpkg-query -W -f='${Status} ${Version}\n' ambari-agent | grep -v deinstall | grep " + projectVersion]
     else:
       Command = ["bash", "-c", "rpm -qa | grep ambari-agent-"+projectVersion]
     ret = execOsCommand(Command)