summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2016-06-27 17:35:57 -0700
committerJonas Bjurel <jonas.bjurel@ericsson.com>2016-09-29 12:06:41 +0000
commitac92fb02d0049cd5735a51849fe490bf9092fbd1 (patch)
tree28ff7be1b551cdee79a7ece75654a0bac0c17456 /deploy
parentc25f5af252949dc1b249f77fe8e33c5ea13c1ad1 (diff)
use pgrep instead of ps
pgrep was added to procps-ng, it is more exact also replace ps -ef in wait_until_fuel_menu_up removed get_fuel_menu_pid Change-Id: I57ad9d2fabbfe5f570e0be3bfb40ef842f95902d Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/install_fuel_master.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/deploy/install_fuel_master.py b/deploy/install_fuel_master.py
index 808d0b14c..a0e28b033 100644
--- a/deploy/install_fuel_master.py
+++ b/deploy/install_fuel_master.py
@@ -156,13 +156,12 @@ class InstallFuelMaster(object):
def wait_until_fuel_menu_up(self):
WAIT_LOOP = 60
SLEEP_TIME = 10
- CMD = 'ps -ef'
- SEARCH = 'fuelmenu'
+ CMD = 'pgrep -f fuelmenu'
fuel_menu_pid = None
with self.ssh:
for i in range(WAIT_LOOP):
ret = self.ssh.exec_cmd(CMD)
- fuel_menu_pid = self.get_fuel_menu_pid(ret, SEARCH)
+ fuel_menu_pid = ret.strip()
if not fuel_menu_pid:
time.sleep(SLEEP_TIME)
else:
@@ -171,11 +170,6 @@ class InstallFuelMaster(object):
raise Exception('Could not find the Fuel Menu Process ID')
return fuel_menu_pid
- def get_fuel_menu_pid(self, printout, search):
- for line in printout.splitlines():
- if line.endswith(search):
- return clean(line)[1]
-
def ssh_exec_cmd(self, cmd, check=True):
with self.ssh:
ret = self.ssh.exec_cmd(cmd, check=check)
@@ -198,7 +192,7 @@ class InstallFuelMaster(object):
def wait_until_installation_completed(self):
WAIT_LOOP = 360
SLEEP_TIME = 10
- CMD = 'ps -ef | grep %s | grep -v grep' % BOOTSTRAP_ADMIN
+ CMD = 'pgrep -f %s' % BOOTSTRAP_ADMIN
install_completed = False
with self.ssh: