From 8da1885d4d47914e0e3026702eea021f0b7c0cee Mon Sep 17 00:00:00 2001 From: Peng Zhihui Date: Mon, 24 Feb 2014 13:53:53 +0800 Subject: [PATCH] Get the cmdline instmod value in finish_install.py modified: interface/ri_oper.py modified: operation/finish_install.py --- interface/ri_oper.py | 1 - operation/finish_install.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/ri_oper.py b/interface/ri_oper.py index 73b1920..546d18a 100644 --- a/interface/ri_oper.py +++ b/interface/ri_oper.py @@ -87,7 +87,6 @@ class Operation: process.stdin.close() while True: line = process.stdout.readline() - print line if not line: break if line[0] == '@' and self.current_step < self.steps: diff --git a/operation/finish_install.py b/operation/finish_install.py index e462227..da3ec99 100755 --- a/operation/finish_install.py +++ b/operation/finish_install.py @@ -14,7 +14,10 @@ homedir = ri_data.StateGrid.home_dir shell = ri_data.StateGrid.shell # run state grid custom scripts -instmode = os.system("cat /proc/cmdline | sed 's/.*instmode=\([^ ]*\).*/\1/'") +f = open('proc/cmdline', 'r') +cmdline = f.readline() +f.close() +instmode = cmdline.split(' ')[0].split('=')[1] if instmode == 'StateGrid': os.system("chroot /mnt /opt/finish_install/StateGrid/setup.sh %s %s %s" %(username, homedir, shell))