summaryrefslogtreecommitdiffstats
path: root/tests/lib/installers
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2016-12-15 10:10:07 +0200
committerTomi Juvonen <tomi.juvonen@nokia.com>2017-04-18 12:35:15 +0300
commit661fbc57a5cd5137a58cc6a285f4b6f91d78e0f0 (patch)
treed360f0856b04a7a26ffb7f0821d6ae39d0433c2c /tests/lib/installers
parent263682e54a4d75d1f33c76735ffa2fe9debe0161 (diff)
Change role of doctor user to _member_
Change role of doctor user to _member_ Do needful changes to API calls Add admin a role to project Add Fuel support JIRA: DOCTOR-80 Change-Id: Ic7f88b9ceb6c4fc90e5e985ecfbc50c907b2367e Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
Diffstat (limited to 'tests/lib/installers')
-rw-r--r--tests/lib/installers/fuel38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/lib/installers/fuel b/tests/lib/installers/fuel
index da0de34b..0c56963c 100644
--- a/tests/lib/installers/fuel
+++ b/tests/lib/installers/fuel
@@ -74,6 +74,31 @@ function installer_apply_patches {
ip netns exec haproxy /usr/lib/ocf/resource.d/fuel/ns_haproxy restart
fi
fi
+
+ np_conf=/etc/nova/policy.json
+ if [ -e $np_conf ]; then
+ entry="os_compute_api:servers:show:host_status"
+ new="rule:admin_or_owner"
+ np_backup="${np_conf}-doctor-saved"
+ if grep -q "${entry}.*${new}" $np_conf; then
+ echo "Not modifying nova policy"
+ elif grep -q "${entry}" $np_conf; then
+ echo "modify nova policy"
+ cp $np_conf $np_backup
+ oldline=$(grep "$entry" $np_conf)
+ newline=$(echo "$oldline" | sed "s/rule.*\"/$new\"/")
+ sed -i "s/$oldline/$newline/" $np_conf
+ service nova-api restart
+ else
+ echo "add nova policy"
+ cp $np_conf $np_backup
+ sed -i "/{/a \ \"${entry}\": \"$new\"" $np_conf
+ service nova-api restart
+ fi
+ else
+ # TODO(tojuvone) policy.json might not exists in Ocata.
+ echo "$np_conf does not exist!!!"
+ fi
' > installer_apply_patches_$node.log 2>&1
done
}
@@ -83,6 +108,8 @@ function setup_installer {
installer_get_ssh_keys
get_controller_ips
installer_apply_patches
+ #Might take a moment for nova-api to restart
+ sleep 20
if ! openstack flavor show $VM_FLAVOR ; then
openstack flavor create --ram 512 --disk 1 $VM_FLAVOR \
&& touch created_doctor_flavor
@@ -138,6 +165,17 @@ function installer_revert_patches {
sed -ie "/# added by doctor script/d" $ep_conf
service ceilometer-agent-notification restart
fi
+
+ np_conf=/etc/nova/policy.json
+ entry="os_compute_api:servers:show:host_status"
+ if [ -e $np_conf ]; then
+ np_backup="${np_conf}-doctor-saved"
+ if [ -e $np_backup ]; then
+ cp -f $np_backup $np_conf
+ rm $np_backup
+ service nova-api restart
+ fi
+ fi
' >> installer_apply_patches_$node.log 2>&1
done
}