Browse code

Merge "Reuse existing libvirt setup functions for Ironic"

Jenkins authored on 2014/03/21 23:54:24
Showing 2 changed files
... ...
@@ -288,20 +288,12 @@ function configure_ironic_dirs {
288 288
     mkdir -p $IRONIC_TFTPBOOT_DIR/pxelinux.cfg
289 289
 }
290 290
 
291
-function ironic_ensure_libvirt_group {
292
-    groups $STACK_USER | grep -q $LIBVIRT_GROUP || adduser $STACK_USER $LIBVIRT_GROUP
293
-}
294
-
295 291
 function create_bridge_and_vms {
296
-    ironic_ensure_libvirt_group
297
-
298 292
     # Call libvirt setup scripts in a new shell to ensure any new group membership
299 293
     sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/setup-network"
300
-
301 294
     sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/create-nodes \
302 295
         $IRONIC_VM_SPECS_CPU $IRONIC_VM_SPECS_RAM $IRONIC_VM_SPECS_DISK \
303 296
         amd64 $IRONIC_VM_COUNT $IRONIC_VM_NETWORK_BRIDGE $IRONIC_VM_EMULATOR" >> $IRONIC_VM_MACS_CSV_FILE
304
-
305 297
 }
306 298
 
307 299
 function enroll_vms {
... ...
@@ -18,6 +18,7 @@
18 18
 MY_XTRACE=$(set +o | grep xtrace)
19 19
 set +o xtrace
20 20
 
21
+source $TOP_DIR/lib/nova_plugins/functions-libvirt
21 22
 
22 23
 # Defaults
23 24
 # --------
... ...
@@ -33,6 +34,7 @@ function cleanup_nova_hypervisor {
33 33
 
34 34
 # configure_nova_hypervisor - Set config files, create data dirs, etc
35 35
 function configure_nova_hypervisor {
36
+    configure_libvirt
36 37
     iniset $NOVA_CONF ironic sql_connection `database_connection_url nova_bm`
37 38
     LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.firewall.NoopFirewallDriver"}
38 39
     iniset $NOVA_CONF DEFAULT compute_driver ironic.nova.virt.ironic.IronicDriver
... ...
@@ -50,8 +52,7 @@ function configure_nova_hypervisor {
50 50
 
51 51
 # install_nova_hypervisor() - Install external components
52 52
 function install_nova_hypervisor {
53
-    # This function intentionally left blank
54
-    :
53
+    install_libvirt
55 54
 }
56 55
 
57 56
 # start_nova_hypervisor - Start any required external services