Browse code

Option for installing spice-html5 and novnc from packages

The novnc and spice-html5 is installed from git repository by default,
but not from an openstack* repository.

In order to add vnc/spice proxy related gating tests they should be installed
from packages.

New boolean variables added to control the installation source:
NOVNC_FROM_PACKAGE and SPICE_FROM_PACKAGE

Related changes:
https://review.openstack.org/#/c/51790/
https://review.openstack.org/#/c/50822/

Change-Id: I1e55fd99edd30876924a13160afb74ff3e97c485

Attila Fazekas authored on 2013/10/29 16:23:43
Showing 2 changed files
... ...
@@ -73,9 +73,6 @@ SCHEDULER=${SCHEDULER:-nova.scheduler.filter_scheduler.FilterScheduler}
73 73
 
74 74
 QEMU_CONF=/etc/libvirt/qemu.conf
75 75
 
76
-NOVNC_DIR=$DEST/noVNC
77
-SPICE_DIR=$DEST/spice-html5
78
-
79 76
 # Set default defaults here as some hypervisor drivers override these
80 77
 PUBLIC_INTERFACE_DEFAULT=br100
81 78
 GUEST_INTERFACE_DEFAULT=eth0
... ...
@@ -590,6 +587,28 @@ function install_nova() {
590 590
         install_nova_hypervisor
591 591
     fi
592 592
 
593
+    if is_service_enabled n-novnc; then
594
+        # a websockets/html5 or flash powered VNC console for vm instances
595
+        if trueorfalse True "$NOVNC_FROM_PACKAGE"; then
596
+            NOVNC_WEB_DIR=/usr/share/novnc
597
+            install_package novnc
598
+        else
599
+            NOVNC_WEB_DIR=$DEST/noVNC
600
+            git_clone $NOVNC_REPO $NOVNC_WEB_DIR $NOVNC_BRANCH
601
+        fi
602
+    fi
603
+
604
+    if is_service_enabled n-spice; then
605
+        # a websockets/html5 or flash powered SPICE console for vm instances
606
+        if trueorfalse True "$SPICE_FROM_PACKAGE"; then
607
+            SPICE_WEB_DIR=/usr/share/spice-html5
608
+            install_package spice-html5
609
+        else
610
+            SPICE_WEB_DIR=$DEST/spice-html5
611
+            git_clone $SPICE_REPO $SPICE_WEB_DIR $SPICE_BRANCH
612
+        fi
613
+    fi
614
+
593 615
     git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH
594 616
     setup_develop $NOVA_DIR
595 617
     sudo install -D -m 0644 -o $STACK_USER {$NOVA_DIR/tools/,/etc/bash_completion.d/}nova-manage.bash_completion
... ...
@@ -658,9 +677,9 @@ function start_nova_rest() {
658 658
     screen_it n-sch "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-scheduler --config-file $compute_cell_conf"
659 659
     screen_it n-api-meta "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-api-metadata --config-file $compute_cell_conf"
660 660
 
661
-    screen_it n-novnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-novncproxy --config-file $api_cell_conf --web $NOVNC_DIR"
661
+    screen_it n-novnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-novncproxy --config-file $api_cell_conf --web $NOVNC_WEB_DIR"
662 662
     screen_it n-xvnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-xvpvncproxy --config-file $api_cell_conf"
663
-    screen_it n-spice "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-spicehtml5proxy --config-file $api_cell_conf --web $SPICE_DIR"
663
+    screen_it n-spice "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-spicehtml5proxy --config-file $api_cell_conf --web $SPICE_WEB_DIR"
664 664
     screen_it n-cauth "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-consoleauth --config-file $api_cell_conf"
665 665
 
666 666
     # Starting the nova-objectstore only if swift3 service is not enabled.
... ...
@@ -694,16 +694,6 @@ if is_service_enabled nova; then
694 694
     configure_nova
695 695
 fi
696 696
 
697
-if is_service_enabled n-novnc; then
698
-    # a websockets/html5 or flash powered VNC console for vm instances
699
-    git_clone $NOVNC_REPO $NOVNC_DIR $NOVNC_BRANCH
700
-fi
701
-
702
-if is_service_enabled n-spice; then
703
-    # a websockets/html5 or flash powered SPICE console for vm instances
704
-    git_clone $SPICE_REPO $SPICE_DIR $SPICE_BRANCH
705
-fi
706
-
707 697
 if is_service_enabled horizon; then
708 698
     # dashboard
709 699
     install_horizon