Generate TOSCA for images; allow waiting for XOS on arbitrary port
diff --git a/xos/configurations/common/make-images-yaml.sh b/xos/configurations/common/make-images-yaml.sh
new file mode 100644
index 0000000..6321a9d
--- /dev/null
+++ b/xos/configurations/common/make-images-yaml.sh
@@ -0,0 +1,48 @@
+FN=$SETUPDIR/images.yaml
+
+rm -f $FN
+
+cat >> $FN <<EOF
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+   - custom_types/xos.yaml
+
+description: autogenerated nodes file
+
+topology_template:
+  node_templates:
+    mysite:
+        type: tosca.nodes.Site
+
+EOF
+
+IMAGES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; glance image-list" |grep -v ID|grep -v +|awk '{print $4}' )
+I=0
+for IMAGE in $IMAGES; do
+    echo $IMAGE
+    cat >> $FN <<EOF
+    $IMAGE:
+      type: tosca.nodes.Image
+      properties:
+         disk_format: QCOW2
+         container_format: BARE
+
+EOF
+done
+
+cat >> $FN <<EOF
+    MyDeployment:
+      type: tosca.nodes.Deployment
+      properties:
+          flavors: m1.large, m1.medium, m1.small
+      requirements:
+EOF
+
+for IMAGE in $IMAGES; do
+    cat >> $FN <<EOF
+          - image:
+              node: $IMAGE
+              relationship: tosca.relationships.SupportsImage
+EOF
+done
diff --git a/xos/configurations/common/wait_for_xos_port.sh b/xos/configurations/common/wait_for_xos_port.sh
new file mode 100755
index 0000000..dab6e70
--- /dev/null
+++ b/xos/configurations/common/wait_for_xos_port.sh
@@ -0,0 +1,23 @@
+#! /bin/bash
+
+display_usage() { 
+    echo -e "\nUsage:\n$0 [xos-listen-port] \n" 
+} 
+
+if [  $# -lt 1 ] 
+then 
+    display_usage
+    exit 1
+fi 
+
+echo "Waiting for XOS to come up"
+until http 0.0.0.0:$1 &> /dev/null
+do
+    sleep 1
+    RUNNING_CONTAINER=`sudo docker ps|grep "xos"|awk '{print $$NF}'`
+    if [[ $RUNNING_CONTAINER == "" ]]; then
+        echo Container may have failed. check with \"make showlogs\'
+        exit 1
+    fi
+done
+echo "XOS is ready"