summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorJonas Bjurel <jonas.bjurel@ericsson.com>2016-09-29 19:47:28 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-09-29 19:47:28 +0000
commitcf93e6ee11c96de090b04196cc96b4a6b0948928 (patch)
tree3af17481497d4745c1ee1701ca5d0d88bdaa0a39 /deploy
parent2e6be7473d11f14d62ad1aa1d76f2e0c99327424 (diff)
parentac92fb02d0049cd5735a51849fe490bf9092fbd1 (diff)
Merge "use pgrep instead of ps"
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: