modfiied to corner the concerns of Orange labs.
[joid.git] / ci / openstack.sh
index 513bf99..80355df 100755 (executable)
@@ -75,9 +75,9 @@ keystoneIp() {
         unitAddress keystone 0
     else
         if [[ "$jujuver" < "2" ]]; then
-            juju get keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']"
+            juju get keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']" | cut -d " " -f 1
         else
-            juju config keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']"
+            juju config keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']" | cut -d " " -f 1
         fi
     fi
 }
@@ -92,7 +92,7 @@ create_openrc() {
         adminPasswd=$(juju config keystone | grep admin-password -A 5 | grep value | awk '{print $2}' 2> /dev/null)
     fi
 
-    configOpenrc admin $adminPasswd admin http://$keystoneIp:35357/v2.0 RegionOne > ~/joid_config/admin-openrc
+    configOpenrc admin $adminPasswd admin http://$keystoneIp:5000/v2.0 RegionOne > ~/joid_config/admin-openrc
     chmod 0600 ~/joid_config/admin-openrc
 }
 
@@ -180,7 +180,7 @@ if ([ "$opnfvlab" == "orangepod1" ] \
             # The public network exists on MAAS, so we push the dns record to it
 
             # Recover maas ips and login to it
-            maas_ip=$(grep " ip_address" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //')
+            maas_ip=$(grep " ip_address" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //')
             maas_pubip=$(grep floating-ip-range ./labconfig.yaml |cut -d, -f4 |perl -pe 's!^(.*)\.\d+/\d+$!$1.5!')
             apikey=$(grep maas-oauth: environments.yaml | cut -d "'" -f 2)
             maas login maas http://${maas_ip}/MAAS/api/1.0 ${apikey}
@@ -219,41 +219,18 @@ echo "...... deploy end public api proxy ......"
 
 if [ "onos" == "$opnfvsdn" ]; then
     launch_eth
-    neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net --router:external=True
-    neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \
-       --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
-       --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
-    #neutron subnet-create ext-net --name ext-subnet $EXTNET_NET
-    #update_gw_mac
-elif [ "nosdn" == "$opnfvsdn" ]; then
     neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net \
-                                                   --router:external=True \
-                                                   --provider:network_type flat \
-                                                   --provider:physical_network physnet1
-
-    neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \
-       --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
-       --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
-
-elif [ "odl" == "$opnfvsdn" ]; then
-    neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net \
-                                                   --router:external=True \
-                                                   --provider:network_type vxlan
-
-    neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \
-        --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
-        --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
- else
+                                                   --router:external=True
+else
     neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net \
                                                    --router:external=True \
                                                    --provider:network_type flat \
                                                    --provider:physical_network physnet1
-
-    neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \
-       --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
-       --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
 fi
 
+neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \
+   --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \
+   --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET
 
 # Create Congress datasources
 sudo apt-get install -y python-congressclient