Check glance is enabled or not

- Check glance is enabled or not before upload sandbox
image to glance.
- Remove unused function is_zun_enabled.

Change-Id: I426298816e1144c66fd13f21949afdb058bce9cb
Closes-Bug: #1650245
This commit is contained in:
Kien Nguyen 2017-09-28 15:36:33 +07:00
parent 20b2048c8d
commit 8fa8843dbc

View File

@ -86,13 +86,6 @@ fi
# Functions
# ---------
# Test if any zun services are enabled
# is_zun_enabled
function is_zun_enabled {
[[ ,${ENABLED_SERVICES} =~ ,"zun-" ]] && return 0
return 1
}
# cleanup_zun() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_zun {
@ -133,7 +126,7 @@ function configure_zun {
# upload_sandbox_image() - Upload sandbox image to glance
function upload_sandbox_image {
if [[ ${ZUN_DRIVER} == "docker" ]]; then
if "${ZUN_DRIVER}" == "docker" && is_service_enabled g-api; then
sudo docker pull kubernetes/pause
sudo docker save kubernetes/pause | openstack image create kubernetes/pause --public --container-format docker --disk-format raw
fi