Merge "Handle LSB data for openSUSE 12.3"
diff --git a/files/apts/n-vol b/files/apts/n-vol
deleted file mode 100644
index 5db06ea..0000000
--- a/files/apts/n-vol
+++ /dev/null
@@ -1,2 +0,0 @@
-tgt
-lvm2
diff --git a/files/rpms-suse/ldap b/files/rpms-suse/ldap
new file mode 100644
index 0000000..46d26f0
--- /dev/null
+++ b/files/rpms-suse/ldap
@@ -0,0 +1,3 @@
+openldap2
+openldap2-client
+python-ldap
diff --git a/files/rpms-suse/n-spice b/files/rpms-suse/n-spice
new file mode 100644
index 0000000..c8722b9
--- /dev/null
+++ b/files/rpms-suse/n-spice
@@ -0,0 +1 @@
+python-numpy
diff --git a/files/rpms-suse/n-vol b/files/rpms-suse/n-vol
deleted file mode 100644
index e5b4727..0000000
--- a/files/rpms-suse/n-vol
+++ /dev/null
@@ -1,2 +0,0 @@
-lvm2
-tgt
diff --git a/files/rpms-suse/nova b/files/rpms-suse/nova
index 0306716..04af7f3 100644
--- a/files/rpms-suse/nova
+++ b/files/rpms-suse/nova
@@ -3,6 +3,7 @@
 dnsmasq
 ebtables
 gawk
+genisoimage # required for config_drive
 iptables
 iputils
 kpartx
@@ -34,6 +35,7 @@
 python-mox
 python-mysql
 python-netaddr
+python-numpy # needed by websockify for spice console
 python-paramiko
 python-python-gflags
 python-sqlalchemy-migrate
diff --git a/files/rpms-suse/ryu b/files/rpms-suse/ryu
index 763fd24..90b43a4 100644
--- a/files/rpms-suse/ryu
+++ b/files/rpms-suse/ryu
@@ -2,4 +2,5 @@
 python-setuptools # instead of python-distribute; dist:sle11sp2
 python-Sphinx
 python-gevent
+python-netifaces
 python-python-gflags
diff --git a/files/rpms/n-vol b/files/rpms/n-vol
deleted file mode 100644
index df861aa..0000000
--- a/files/rpms/n-vol
+++ /dev/null
@@ -1,2 +0,0 @@
-lvm2
-scsi-target-utils
diff --git a/lib/ceilometer b/lib/ceilometer
index c04371d..d90694c 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -68,7 +68,7 @@
 
     iniset $CEILOMETER_CONF DEFAULT notification_topics 'notifications,glance_notifications'
     iniset $CEILOMETER_CONF DEFAULT verbose True
-    iniset $CEILOMETER_CONF DEFAULT sql_connection $BASE_SQL_CONN/nova?charset=utf8
+    iniset $CEILOMETER_CONF DEFAULT `database_connection_url nova`
 
     # Install the policy file for the API server
     cp $CEILOMETER_DIR/etc/ceilometer/policy.json $CEILOMETER_CONF_DIR
diff --git a/lib/cinder b/lib/cinder
index d8ad142..b3e1904 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -186,9 +186,7 @@
         iniset $CINDER_CONF DEFAULT volume_name_template ${VOLUME_NAME_PREFIX}%s
     fi
     iniset $CINDER_CONF DEFAULT iscsi_helper tgtadm
-    local dburl
-    database_connection_url dburl cinder
-    iniset $CINDER_CONF DEFAULT sql_connection $dburl
+    iniset $CINDER_CONF DEFAULT sql_connection `database_connection_url cinder`
     iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
     iniset $CINDER_CONF DEFAULT rootwrap_config "$CINDER_CONF_DIR/rootwrap.conf"
     iniset $CINDER_CONF DEFAULT osapi_volume_extension cinder.api.contrib.standard_extensions
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 94aedc6..ec65c36 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -115,9 +115,8 @@
 }
 
 function database_connection_url_mysql {
-    local output=$1
-    local db=$2
-    eval "$output=$BASE_SQL_CONN/$db?charset=utf8"
+    local db=$1
+    echo "$BASE_SQL_CONN/$db?charset=utf8"
 }
 
 # Restore xtrace
diff --git a/lib/databases/postgresql b/lib/databases/postgresql
index 2c37f49..7d4a6c5 100644
--- a/lib/databases/postgresql
+++ b/lib/databases/postgresql
@@ -70,9 +70,8 @@
 }
 
 function database_connection_url_postgresql {
-    local output=$1
-    local db=$2
-    eval "$output=$BASE_SQL_CONN/$db?client_encoding=utf8"
+    local db=$1
+    echo "$BASE_SQL_CONN/$db?client_encoding=utf8"
 }
 
 # Restore xtrace
diff --git a/lib/glance b/lib/glance
index a6b698f..9ec2112 100644
--- a/lib/glance
+++ b/lib/glance
@@ -81,8 +81,7 @@
     cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
     iniset $GLANCE_REGISTRY_CONF DEFAULT debug True
     inicomment $GLANCE_REGISTRY_CONF DEFAULT log_file
-    local dburl
-    database_connection_url dburl glance
+    local dburl=`database_connection_url glance`
     iniset $GLANCE_REGISTRY_CONF DEFAULT sql_connection $dburl
     iniset $GLANCE_REGISTRY_CONF DEFAULT use_syslog $SYSLOG
     iniset $GLANCE_REGISTRY_CONF paste_deploy flavor keystone
diff --git a/lib/heat b/lib/heat
index 5b8b360..56d6f39 100644
--- a/lib/heat
+++ b/lib/heat
@@ -117,9 +117,7 @@
     iniset $HEAT_ENGINE_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
     iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
     iniset $HEAT_ENGINE_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
-    local dburl
-    database_connection_url dburl heat
-    iniset $HEAT_ENGINE_CONF DEFAULT sql_connection $dburl
+    iniset $HEAT_ENGINE_CONF DEFAULT sql_connection `database_connection_url heat`
     iniset $HEAT_ENGINE_CONF DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/random`
 
     iniset_rpc_backend heat $HEAT_ENGINE_CONF DEFAULT
diff --git a/lib/keystone b/lib/keystone
index 2580351..16b6d6c 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -91,8 +91,6 @@
     fi
 
     # Rewrite stock ``keystone.conf``
-    local dburl
-    database_connection_url dburl keystone
 
     if is_service_enabled ldap; then
         #Set all needed ldap values
@@ -123,7 +121,7 @@
 
     iniset $KEYSTONE_CONF DEFAULT admin_token "$SERVICE_TOKEN"
     iniset $KEYSTONE_CONF signing token_format "$KEYSTONE_TOKEN_FORMAT"
-    iniset $KEYSTONE_CONF sql connection $dburl
+    iniset $KEYSTONE_CONF sql connection `database_connection_url keystone`
     iniset $KEYSTONE_CONF ec2 driver "keystone.contrib.ec2.backends.sql.Ec2"
     sed -e "
         /^pipeline.*ec2_extension crud_/s|ec2_extension crud_extension|ec2_extension s3_extension crud_extension|;
diff --git a/lib/ldap b/lib/ldap
index 5cb4534..0a0d197 100644
--- a/lib/ldap
+++ b/lib/ldap
@@ -16,13 +16,11 @@
     echo "os_VENDOR is $os_VENDOR"
     printf "installing"
     if is_ubuntu; then
-        echo "os vendor is Ubuntu"
         LDAP_OLCDB_NUMBER=1
         LDAP_ROOTPW_COMMAND=replace
         sudo DEBIAN_FRONTEND=noninteractive apt-get install slapd ldap-utils
         #automatically starts LDAP on ubuntu so no need to call start_ldap
-    elif is_fedora; then
-        echo "os vendor is Fedora"
+    elif is_fedora || is_suse; then
         LDAP_OLCDB_NUMBER=2
         LDAP_ROOTPW_COMMAND=add
         start_ldap
diff --git a/lib/nova b/lib/nova
index 3749790..42b6139 100644
--- a/lib/nova
+++ b/lib/nova
@@ -377,12 +377,9 @@
     iniset $NOVA_CONF DEFAULT s3_port "$S3_SERVICE_PORT"
     iniset $NOVA_CONF DEFAULT osapi_compute_extension "nova.api.openstack.compute.contrib.standard_extensions"
     iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP"
-    local dburl
-    database_connection_url dburl nova
-    iniset $NOVA_CONF DEFAULT sql_connection "$dburl"
+    iniset $NOVA_CONF DEFAULT sql_connection `database_connection_url nova`
     if is_baremetal; then
-        database_connection_url dburl nova_bm
-        iniset $NOVA_CONF baremetal sql_connection $dburl
+        iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
     fi
     iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
     iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
diff --git a/lib/quantum b/lib/quantum
index eebbabf..66360d4 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -416,9 +416,7 @@
     Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
     cp $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
 
-    database_connection_url dburl $Q_DB_NAME
-    iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl
-    unset dburl
+    iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection `database_connection_url $Q_DB_NAME`
 
     _quantum_setup_rootwrap
 }
@@ -539,6 +537,7 @@
     iniset $QUANTUM_CONF DEFAULT verbose True
     iniset $QUANTUM_CONF DEFAULT debug True
     iniset $QUANTUM_CONF DEFAULT state_path $DATA_DIR/quantum
+    iniset $QUANTUM_CONF DEFAULT policy_file $Q_POLICY_FILE
     iniset $QUANTUM_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP
 
     iniset $QUANTUM_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
diff --git a/lib/quantum_plugins/README.md b/lib/quantum_plugins/README.md
index a66d35a..5411de0 100644
--- a/lib/quantum_plugins/README.md
+++ b/lib/quantum_plugins/README.md
@@ -18,7 +18,7 @@
 * ``quantum_plugin_create_nova_conf`` :
   set ``NOVA_VIF_DRIVER`` and optionally set options in nova_conf
   e.g.
-  NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver"}
+  NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
 * ``quantum_plugin_install_agent_packages`` :
   install packages that is specific to plugin agent
   e.g.
diff --git a/lib/quantum_plugins/agent_loadbalancer b/lib/quantum_plugins/agent_loadbalancer
index a4d6dff..87e7aaa 100644
--- a/lib/quantum_plugins/agent_loadbalancer
+++ b/lib/quantum_plugins/agent_loadbalancer
@@ -11,6 +11,9 @@
 function quantum_agent_lbaas_install_agent_packages() {
     if is_ubuntu || is_fedora; then
         install_package haproxy
+    elif is_suse; then
+        ### FIXME: Find out if package can be pushed to Factory
+        echo "HAProxy packages can be installed from server:http project in OBS"
     fi
 }
 
diff --git a/lib/quantum_plugins/bigswitch_floodlight b/lib/quantum_plugins/bigswitch_floodlight
index 2c928be..7d3fd96 100644
--- a/lib/quantum_plugins/bigswitch_floodlight
+++ b/lib/quantum_plugins/bigswitch_floodlight
@@ -9,7 +9,7 @@
 source $TOP_DIR/lib/quantum_thirdparty/bigswitch_floodlight     # for third party service specific configuration values
 
 function quantum_plugin_create_nova_conf() {
-    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver"}
+    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
 }
 
 function quantum_plugin_install_agent_packages() {
diff --git a/lib/quantum_plugins/brocade b/lib/quantum_plugins/brocade
index c372c19..ac91143 100644
--- a/lib/quantum_plugins/brocade
+++ b/lib/quantum_plugins/brocade
@@ -10,7 +10,7 @@
 }
 
 function quantum_plugin_create_nova_conf() {
-    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver"}
+    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
 }
 
 function quantum_plugin_install_agent_packages() {
diff --git a/lib/quantum_plugins/linuxbridge b/lib/quantum_plugins/linuxbridge
index 0756de4..11bc585 100644
--- a/lib/quantum_plugins/linuxbridge
+++ b/lib/quantum_plugins/linuxbridge
@@ -11,7 +11,7 @@
 }
 
 function quantum_plugin_create_nova_conf() {
-    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver"}
+    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
 }
 
 function quantum_plugin_install_agent_packages() {
diff --git a/lib/quantum_plugins/openvswitch b/lib/quantum_plugins/openvswitch
index a57336e..dda1239 100644
--- a/lib/quantum_plugins/openvswitch
+++ b/lib/quantum_plugins/openvswitch
@@ -8,7 +8,7 @@
 source $TOP_DIR/lib/quantum_plugins/ovs_base
 
 function quantum_plugin_create_nova_conf() {
-    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver"}
+    NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
     if [ "$VIRT_DRIVER" = 'xenserver' ]; then
         iniset $NOVA_CONF DEFAULT xenapi_vif_driver nova.virt.xenapi.vif.XenAPIOpenVswitchDriver
         iniset $NOVA_CONF DEFAULT xenapi_ovs_integration_bridge $FLAT_NETWORK_BRIDGE
diff --git a/lib/quantum_plugins/ovs_base b/lib/quantum_plugins/ovs_base
index 915129e..ab988d9 100644
--- a/lib/quantum_plugins/ovs_base
+++ b/lib/quantum_plugins/ovs_base
@@ -29,8 +29,8 @@
         # Ensure that the service is started
         restart_service openvswitch
     elif is_suse; then
-        ### FIXME: Find RPMs for OpenVSwitch
-        echo "OpenVSwitch packages need to be located"
+        ### FIXME: Find out if package can be pushed to Factory
+        echo "OpenVSwitch packages can be installed from Cloud:OpenStack:Master in OBS"
         restart_service openvswitch
     fi
 }
diff --git a/lib/swift b/lib/swift
index 5ba7e56..2f772fb 100644
--- a/lib/swift
+++ b/lib/swift
@@ -352,6 +352,9 @@
 function start_swift() {
     # (re)start rsyslog
     restart_service rsyslog
+    # (re)start memcached to make sure we have a clean memcache.
+    restart_service memcached
+
     # Start rsync
     if is_ubuntu; then
         sudo /etc/init.d/rsync restart || :
diff --git a/lib/tempest b/lib/tempest
index 9cc19ae..85e643e 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -266,10 +266,6 @@
 # install_tempest() - Collect source and prepare
 function install_tempest() {
     git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
-
-    # Tempest doesn't satisfy its dependencies on its own, so
-    # install them here instead.
-    pip_install -r $TEMPEST_DIR/tools/pip-requires
 }
 
 # init_tempest() - Initialize ec2 images
diff --git a/stackrc b/stackrc
index 008bc9c..d418a0e 100644
--- a/stackrc
+++ b/stackrc
@@ -45,15 +45,15 @@
 CEILOMETER_BRANCH=master
 
 # ceilometer client library
-CEILOMETERCLIENT_REPO=${GIT_BASE}/openstack/python-ceilometerclient
+CEILOMETERCLIENT_REPO=${GIT_BASE}/openstack/python-ceilometerclient.git
 CEILOMETERCLIENT_BRANCH=master
 
 # volume service
-CINDER_REPO=${GIT_BASE}/openstack/cinder
+CINDER_REPO=${GIT_BASE}/openstack/cinder.git
 CINDER_BRANCH=master
 
 # volume client
-CINDERCLIENT_REPO=${GIT_BASE}/openstack/python-cinderclient
+CINDERCLIENT_REPO=${GIT_BASE}/openstack/python-cinderclient.git
 CINDERCLIENT_BRANCH=master
 
 # compute service
@@ -63,11 +63,11 @@
 # storage service
 SWIFT_REPO=${GIT_BASE}/openstack/swift.git
 SWIFT_BRANCH=master
-SWIFT3_REPO=https://github.com/fujita/swift3.git
+SWIFT3_REPO=${GIT_BASE}/fujita/swift3.git
 SWIFT3_BRANCH=master
 
 # python swift client library
-SWIFTCLIENT_REPO=${GIT_BASE}/openstack/python-swiftclient
+SWIFTCLIENT_REPO=${GIT_BASE}/openstack/python-swiftclient.git
 SWIFTCLIENT_BRANCH=master
 
 # image catalog service
@@ -75,7 +75,7 @@
 GLANCE_BRANCH=master
 
 # python glance client library
-GLANCECLIENT_REPO=${GIT_BASE}/openstack/python-glanceclient
+GLANCECLIENT_REPO=${GIT_BASE}/openstack/python-glanceclient.git
 GLANCECLIENT_BRANCH=master
 
 # unified auth system (manages accounts/tokens)
@@ -83,7 +83,7 @@
 KEYSTONE_BRANCH=master
 
 # a websockets/html5 or flash powered VNC console for vm instances
-NOVNC_REPO=https://github.com/kanaka/noVNC.git
+NOVNC_REPO=${GIT_BASE}/kanaka/noVNC.git
 NOVNC_BRANCH=master
 
 # a websockets/html5 or flash powered SPICE console for vm instances
@@ -103,15 +103,15 @@
 OPENSTACKCLIENT_BRANCH=master
 
 # python keystone client library to nova that horizon uses
-KEYSTONECLIENT_REPO=${GIT_BASE}/openstack/python-keystoneclient
+KEYSTONECLIENT_REPO=${GIT_BASE}/openstack/python-keystoneclient.git
 KEYSTONECLIENT_BRANCH=master
 
 # quantum service
-QUANTUM_REPO=${GIT_BASE}/openstack/quantum
+QUANTUM_REPO=${GIT_BASE}/openstack/quantum.git
 QUANTUM_BRANCH=master
 
 # quantum client
-QUANTUMCLIENT_REPO=${GIT_BASE}/openstack/python-quantumclient
+QUANTUMCLIENT_REPO=${GIT_BASE}/openstack/python-quantumclient.git
 QUANTUMCLIENT_BRANCH=master
 
 # Tempest test suite
@@ -127,17 +127,17 @@
 HEATCLIENT_BRANCH=master
 
 # ryu service
-RYU_REPO=https://github.com/osrg/ryu.git
+RYU_REPO=${GIT_BASE}/osrg/ryu.git
 RYU_BRANCH=master
 
 # diskimage-builder
-BM_IMAGE_BUILD_REPO=https://github.com/stackforge/diskimage-builder.git
+BM_IMAGE_BUILD_REPO=${GIT_BASE}/stackforge/diskimage-builder.git
 BM_IMAGE_BUILD_BRANCH=master
 
 # bm_poseur
 # Used to simulate a hardware environment for baremetal
 # Only used if BM_USE_FAKE_ENV is set
-BM_POSEUR_REPO=https://github.com/tripleo/bm_poseur.git
+BM_POSEUR_REPO=${GIT_BASE}/tripleo/bm_poseur.git
 BM_POSEUR_BRANCH=master
 
 
diff --git a/tools/xen/devstackubuntupreseed.cfg b/tools/xen/devstackubuntupreseed.cfg
index d8caaee..c559b1e 100644
--- a/tools/xen/devstackubuntupreseed.cfg
+++ b/tools/xen/devstackubuntupreseed.cfg
@@ -257,7 +257,7 @@
 
 # The kernel image (meta) package to be installed; "none" can be used if no
 # kernel is to be installed.
-#d-i base-installer/kernel/image string linux-generic
+d-i base-installer/kernel/image string linux-virtual
 
 ### Account setup
 # Skip creation of a root account (normal user account will be able to
diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh
index f0e057b..0c0e1e2 100755
--- a/tools/xen/install_os_domU.sh
+++ b/tools/xen/install_os_domU.sh
@@ -20,13 +20,13 @@
 fi
 
 # This directory
-TOP_DIR=$(cd $(dirname "$0") && pwd)
+THIS_DIR=$(cd $(dirname "$0") && pwd)
 
 # Source lower level functions
-. $TOP_DIR/../../functions
+. $THIS_DIR/../../functions
 
 # Include onexit commands
-. $TOP_DIR/scripts/on_exit.sh
+. $THIS_DIR/scripts/on_exit.sh
 
 
 #
@@ -49,7 +49,7 @@
 # including installing XenAPI plugins
 #
 
-cd $TOP_DIR
+cd $THIS_DIR
 if [ -f ./master ]
 then
     rm -rf ./master
@@ -271,7 +271,7 @@
             HTTP_SERVER_LOCATION="/var/www/html"
             mkdir -p $HTTP_SERVER_LOCATION
         fi
-        cp -f $TOP_DIR/devstackubuntupreseed.cfg $HTTP_SERVER_LOCATION
+        cp -f $THIS_DIR/devstackubuntupreseed.cfg $HTTP_SERVER_LOCATION
         MIRROR=${MIRROR:-""}
         if [ -n "$MIRROR" ]; then
             sed -e "s,d-i mirror/http/hostname string .*,d-i mirror/http/hostname string $MIRROR," \
@@ -280,11 +280,11 @@
     fi
 
     # Update the template
-    $TOP_DIR/scripts/install_ubuntu_template.sh $PRESEED_URL
+    $THIS_DIR/scripts/install_ubuntu_template.sh $PRESEED_URL
 
     # create a new VM with the given template
     # creating the correct VIFs and metadata
-    $TOP_DIR/scripts/install-os-vpx.sh -t "$UBUNTU_INST_TEMPLATE_NAME" -v $VM_BR -m $MGT_BR -p $PUB_BR -l $GUEST_NAME -r $OSDOMU_MEM_MB -k "flat_network_bridge=${VM_BR}"
+    $THIS_DIR/scripts/install-os-vpx.sh -t "$UBUNTU_INST_TEMPLATE_NAME" -v $VM_BR -m $MGT_BR -p $PUB_BR -l $GUEST_NAME -r $OSDOMU_MEM_MB -k "flat_network_bridge=${VM_BR}"
 
     # wait for install to finish
     wait_for_VM_to_halt
@@ -298,7 +298,7 @@
     #
 
     # Install XenServer tools, and other such things
-    $TOP_DIR/prepare_guest_template.sh "$GUEST_NAME"
+    $THIS_DIR/prepare_guest_template.sh "$GUEST_NAME"
 
     # start the VM to run the prepare steps
     xe vm-start vm="$GUEST_NAME"
@@ -320,7 +320,7 @@
 #
 # Inject DevStack inside VM disk
 #
-$TOP_DIR/build_xva.sh "$GUEST_NAME"
+$THIS_DIR/build_xva.sh "$GUEST_NAME"
 
 # create a snapshot before the first boot
 # to allow a quick re-run with the same settings
diff --git a/tools/xen/xenrc b/tools/xen/xenrc
index 1a5a2a9..e4d8ac9 100644
--- a/tools/xen/xenrc
+++ b/tools/xen/xenrc
@@ -32,10 +32,10 @@
 PUB_IP=${PUB_IP:-192.168.1.55}
 
 # Public network
-PUB_BR=${PUB_BR:-"xenbr0"}
-PUB_DEV=${PUB_DEV:-eth0}
-PUB_VLAN=${PUB_VLAN:--1}
 PUB_NETMASK=${PUB_NETMASK:-255.255.255.0}
+PUB_BR=${PUB_BR:-"xenbr0"}
+PUB_VLAN=${PUB_VLAN:--1}
+PUB_DEV=${PUB_DEV:-eth0}
 
 # VM network params
 VM_NETMASK=${VM_NETMASK:-255.255.255.0}