Browse code

Merge "Optionally enable file injection"

Jenkins authored on 2014/02/15 11:28:09
Showing 2 changed files
... ...
@@ -513,12 +513,6 @@ function create_nova_conf() {
513 513
     iniset $NOVA_CONF DEFAULT ec2_dmz_host "$EC2_DMZ_HOST"
514 514
     iniset_rpc_backend nova $NOVA_CONF DEFAULT
515 515
     iniset $NOVA_CONF DEFAULT glance_api_servers "$GLANCE_HOSTPORT"
516
-
517
-    if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
518
-        # File injection is being disabled by default in the near future -
519
-        # disable it here for now to avoid surprises later.
520
-        iniset $NOVA_CONF libvirt inject_partition '-2'
521
-    fi
522 516
 }
523 517
 
524 518
 function init_nova_cells() {
... ...
@@ -23,6 +23,9 @@ set +o xtrace
23 23
 # Defaults
24 24
 # --------
25 25
 
26
+# File injection is disabled by default in Nova.  This will turn it back on.
27
+ENABLE_FILE_INJECTION=${ENABLE_FILE_INJECTION:-False}
28
+
26 29
 
27 30
 # Entry Points
28 31
 # ------------
... ...
@@ -116,6 +119,19 @@ EOF"
116 116
     if is_arch "ppc64"; then
117 117
         iniset $NOVA_CONF DEFAULT vnc_enabled "false"
118 118
     fi
119
+
120
+    ENABLE_FILE_INJECTION=$(trueorfalse False $ENABLE_FILE_INJECTION)
121
+    if [[ "$ENABLE_FILE_INJECTION" = "True" ]] ; then
122
+        # When libguestfs is available for file injection, enable using
123
+        # libguestfs to inspect the image and figure out the proper
124
+        # partition to inject into.
125
+        iniset $NOVA_CONF libvirt inject_partition '-1'
126
+        iniset $NOVA_CONF libvirt inject_key 'true'
127
+    else
128
+        # File injection is being disabled by default in the near future -
129
+        # disable it here for now to avoid surprises later.
130
+        iniset $NOVA_CONF libvirt inject_partition '-2'
131
+    fi
119 132
 }
120 133
 
121 134
 # install_nova_hypervisor() - Install external components