summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ball <bob.ball@citrix.com>2016-08-04 08:11:00 +0000
committerBob Ball <bob.ball@citrix.com>2016-08-04 08:11:00 +0000
commit28f51a8d8d1fb1c6ff85b48cfa2f99499c50eb75 (patch)
treee02216617b1df0ac2800fefeecaf1d42665f26b3
parent8b0701cced23281ea98dc479d19c9d2097c74592 (diff)
Revert "Delete image TestVM only"
Notes
Notes (review): Code-Review+2: Bob Ball <bob.ball@citrix.com> Workflow+1: Bob Ball <bob.ball@citrix.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 04 Aug 2016 08:15:10 +0000 Reviewed-on: https://review.openstack.org/351054 Project: openstack/fuel-plugin-xenserver Branch: refs/heads/8.0
-rwxr-xr-xdeployment_scripts/controller_post_deployment.sh41
-rw-r--r--metadata.yaml2
2 files changed, 20 insertions, 23 deletions
diff --git a/deployment_scripts/controller_post_deployment.sh b/deployment_scripts/controller_post_deployment.sh
index 1627f3e..36ecb4a 100755
--- a/deployment_scripts/controller_post_deployment.sh
+++ b/deployment_scripts/controller_post_deployment.sh
@@ -4,7 +4,14 @@ LOG_ROOT="/var/log/fuel-plugin-xenserver/"
4mkdir -p $LOG_ROOT 4mkdir -p $LOG_ROOT
5LOG_FILE=$LOG_ROOT"controller_post_deployment.log" 5LOG_FILE=$LOG_ROOT"controller_post_deployment.log"
6 6
7function replace_test_image { 7function clear_images {
8 for ID in $(glance image-list | awk 'NR>2{print $2}' | grep -v '^$');
9 do
10 glance image-delete $ID &>> $LOG_FILE
11 done
12}
13
14function create_image {
8 local image_name 15 local image_name
9 image_name="$1" 16 image_name="$1"
10 17
@@ -14,22 +21,16 @@ function replace_test_image {
14 local image_file 21 local image_file
15 image_file="$3" 22 image_file="$3"
16 23
17 image_id=$(glance image-list | grep "$image_name" | awk -F "|" '{print $2}' | grep -v '^$') 24 if ! glance image-list | grep -q "$image_name"; then
18 25 glance image-create \
19 if [[ -n "$image_id" ]]; then 26 --name "$image_name" \
20 echo "Delete image $image_name" >> $LOG_FILE 27 --container-format ovf \
21 glance image-delete $image_id &>> $LOG_FILE 28 --disk-format vhd \
29 --property vm_mode="$vm_mode" \
30 --visibility public \
31 --file "$image_file" \
32 &>> $LOG_FILE
22 fi 33 fi
23
24 echo "Create image $image_name" >> $LOG_FILE
25 glance image-create \
26 --name "$image_name" \
27 --container-format ovf \
28 --disk-format vhd \
29 --property vm_mode="$vm_mode" \
30 --visibility public \
31 --file "$image_file" \
32 &>> $LOG_FILE
33} 34}
34 35
35function mod_novnc { 36function mod_novnc {
@@ -52,12 +53,8 @@ EOF
52 53
53source /root/openrc admin 54source /root/openrc admin
54 55
55echo "Before image replacement" >> $LOG_FILE 56clear_images
56glance image-list >> $LOG_FILE 57create_image "TestVM" "xen" cirros-0.3.4-x86_64-disk.vhd.tgz
57
58replace_test_image "TestVM" "xen" cirros-0.3.4-x86_64-disk.vhd.tgz
59
60echo "After image replacement" >> $LOG_FILE
61glance image-list >> $LOG_FILE 58glance image-list >> $LOG_FILE
62 59
63mod_novnc 60mod_novnc
diff --git a/metadata.yaml b/metadata.yaml
index 9564ca9..6cb1a1b 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -3,7 +3,7 @@ name: fuel-plugin-xenserver
3# Human-readable name for your plugin 3# Human-readable name for your plugin
4title: XenServer Plugin 4title: XenServer Plugin
5# Plugin version 5# Plugin version
6version: '3.90.3' 6version: '3.90.2'
7# Description 7# Description
8description: Enable Mirantis OpenStack to integrate with Xenserver 8description: Enable Mirantis OpenStack to integrate with Xenserver
9# Required fuel version 9# Required fuel version