From 921d251301fc29d2291ca29e90d08f9d6c3172b9 Mon Sep 17 00:00:00 2001 From: jjhua Date: Thu, 26 Dec 2013 12:41:15 -0500 Subject: [PATCH] if there are two roles for one chef-client, the script couldn't assign the roles to the node. fixed it. --- xCAT-OpenStack/postscripts/loadclouddata | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xCAT-OpenStack/postscripts/loadclouddata b/xCAT-OpenStack/postscripts/loadclouddata index 3f8de9c7e..7a140b1ad 100755 --- a/xCAT-OpenStack/postscripts/loadclouddata +++ b/xCAT-OpenStack/postscripts/loadclouddata @@ -206,11 +206,18 @@ then exit 1 fi + roles=`echo $roles | sed -e 's/ /,/g'` + r=""; + for onerole in $roles + do + r+="role[$onerole]," + done + # assign the role for the chef node - knife node run_list add $c_fullname "role[$roles]" + knife node run_list add $c_fullname "$r" if [ $? != 0 ] then - errmsg="Failed to run knife node run_list add $client 'role[$roles]' on the chef-server $NODE." + errmsg="Failed to run knife node run_list add $client '$r' on the chef-server $NODE." logger -t xcat -p local4.err $errmsg echo $errmsg exit 1