Merge branch 'ceilometer_custom_image' of https://github.com/open-cloud/xos into ceilometer_custom_image
diff --git a/xos/synchronizers/exampleservice/steps/exampletenant_playbook.yaml b/xos/synchronizers/exampleservice/steps/exampletenant_playbook.yaml
index 82a5af1..9da06f5 100644
--- a/xos/synchronizers/exampleservice/steps/exampletenant_playbook.yaml
+++ b/xos/synchronizers/exampleservice/steps/exampletenant_playbook.yaml
@@ -1,4 +1,6 @@
---
+# exampletenant_playbook
+
- hosts: "{{ instance_name }}"
connection: ssh
user: ubuntu
@@ -10,15 +12,7 @@
apt:
name=apache2
update_cache=yes
- notify:
- - restart apache
- name: write message
shell: echo "{{ tenant_message }}" > /var/www/html/index.html
- handlers:
- - name: restart apache
- service:
- name=apache2
- state=restarted
-
diff --git a/xos/tosca/resources/node.py b/xos/tosca/resources/node.py
index b7f426d..99e756f 100644
--- a/xos/tosca/resources/node.py
+++ b/xos/tosca/resources/node.py
@@ -30,13 +30,18 @@
siteDeployment = self.get_xos_object(SiteDeployment, site=site, deployment=deployment, throw_exception=True)
args["site_deployment"] = siteDeployment
+ return args
+
+ def postprocess(self, obj):
+ # We can't set the labels when we create a Node, because they're
+ # ManyToMany related, and the node doesn't exist yet.
labels=[]
for label_name in self.get_requirements("tosca.relationships.HasLabel"):
labels.append(self.get_xos_object(NodeLabel, name=label_name))
if labels:
- args["labels"] = labels
-
- return args
+ self.info("Updated labels for node '%s'" % obj)
+ obj.labels = labels
+ obj.save()
def create(self):
nodetemplate = self.nodetemplate