Merge branch 'master' into feature/lts
diff --git a/xos/configurations/cord-pod/Makefile b/xos/configurations/cord-pod/Makefile
index 96992f3..6aedc0a 100644
--- a/xos/configurations/cord-pod/Makefile
+++ b/xos/configurations/cord-pod/Makefile
@@ -42,7 +42,12 @@
sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/cord-volt-devices.yaml
exampleservice:
- sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/pod-exampleservice.yaml
+ sudo cp id_rsa key_import/exampleservice_rsa
+ sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/onboard/exampleservice/exampleservice-onboard.yaml
+ bash ../common/wait_for_onboarding_ready.sh 81 xos
+ bash ../common/wait_for_xos_port.sh 80
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/pod-exampleservice.yaml
cord-ceilometer: ceilometer_custom_images cord
sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/ceilometer.yaml
diff --git a/xos/onboard/exampleservice/exampleservice-onboard.yaml b/xos/onboard/exampleservice/exampleservice-onboard.yaml
index 91dbb2e..9999a38 100644
--- a/xos/onboard/exampleservice/exampleservice-onboard.yaml
+++ b/xos/onboard/exampleservice/exampleservice-onboard.yaml
@@ -17,6 +17,7 @@
admin: admin.py
synchronizer: synchronizer/manifest
tosca_custom_types: exampleservice.yaml
+ tosca_resource: tosca/resources/exampleservice.py, tosca/resources/exampletenant.py
rest_service: api/service/exampleservice.py
rest_tenant: api/tenant/exampletenant.py
private_key: file:///opt/xos/key_import/exampleservice_rsa
diff --git a/xos/tosca/resources/exampleservice._unused b/xos/onboard/exampleservice/tosca/resources/exampleservice.py
similarity index 100%
rename from xos/tosca/resources/exampleservice._unused
rename to xos/onboard/exampleservice/tosca/resources/exampleservice.py
diff --git a/xos/tosca/resources/exampletenant._unused b/xos/onboard/exampleservice/tosca/resources/exampletenant.py
similarity index 100%
rename from xos/tosca/resources/exampletenant._unused
rename to xos/onboard/exampleservice/tosca/resources/exampletenant.py
diff --git a/xos/tools/xos-manage b/xos/tools/xos-manage
index 18b3a70..33b0f1a 100755
--- a/xos/tools/xos-manage
+++ b/xos/tools/xos-manage
@@ -152,6 +152,14 @@
python ./manage.py makemigrations vtn
python ./manage.py makemigrations fabric
#python ./manage.py makemigrations servcomp
+
+ if [[ -e /opt/xos/xos/xosbuilder_migration_list ]]; then
+ cat /opt/xos/xos/xosbuilder_migration_list | while read line; do
+ if [[ ! -z "$line" ]]; then
+ python ./manage.py makemigrations $line
+ fi
+ done
+ fi
}
function remigrate {
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 9497b6d..9e6cb41 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -80,6 +80,10 @@
type: string
required: false
description: url of tosca custom_types
+ tosca_resource:
+ type: string
+ required: false
+ description: url of tosca resource
rest_service:
type: string
required: false
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 66229d5..0888c53 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -188,6 +188,10 @@
type: string
required: false
description: url of tosca custom_types
+ tosca_resource:
+ type: string
+ required: false
+ description: url of tosca resource
rest_service:
type: string
required: false
diff --git a/xos/tosca/resources/servicecontroller.py b/xos/tosca/resources/servicecontroller.py
index 34b95c2..d821b56 100644
--- a/xos/tosca/resources/servicecontroller.py
+++ b/xos/tosca/resources/servicecontroller.py
@@ -15,25 +15,33 @@
copyin_props = ["base_url"]
def postprocess_resource_prop(self, obj, kind, format):
- value = self.get_property(kind)
- if value:
- scr = ServiceControllerResource.objects.filter(service_controller=obj, kind=kind, format=format)
- if scr:
- scr=scr[0]
- if scr.url != value:
- self.info("updating resource %s" % kind)
- scr.url = value
+ values = self.get_property(kind)
+ if values:
+ for i,value in enumerate(values.split(",")):
+ value = value.strip()
+
+ name=kind
+ if i>0:
+ name = "%s_%d" %( name, i)
+
+ scr = ServiceControllerResource.objects.filter(service_controller=obj, name=name, kind=kind, format=format)
+ if scr:
+ scr=scr[0]
+ if scr.url != value:
+ self.info("updating resource %s" % kind)
+ scr.url = value
+ scr.save()
+ else:
+ self.info("adding resource %s" % kind)
+ scr = ServiceControllerResource(service_controller=obj, name=name, kind=kind, format=format, url=value)
scr.save()
- else:
- self.info("adding resource %s" % kind)
- scr = ServiceControllerResource(service_controller=obj, name=kind, kind=kind, format=format, url=value)
- scr.save()
def postprocess(self, obj):
# allow these common resource to be specified directly by the ServiceController tosca object
self.postprocess_resource_prop(obj, "models", "python")
self.postprocess_resource_prop(obj, "admin", "python")
self.postprocess_resource_prop(obj, "tosca_custom_types", "yaml")
+ self.postprocess_resource_prop(obj, "tosca_resource", "python")
self.postprocess_resource_prop(obj, "synchronizer", "manifest")
self.postprocess_resource_prop(obj, "private_key", "raw")
self.postprocess_resource_prop(obj, "public_key", "raw")