fixed KeyError when services lacks a nova-compute key
diff --git a/library/juju_facts.py b/library/juju_facts.py
index 2470504..3ba02c8 100644
--- a/library/juju_facts.py
+++ b/library/juju_facts.py
@@ -17,8 +17,9 @@
juju_machines[data_underscore["dns_name"]]["machine_id"] = index
juju_compute_nodes = {}
-for name, data in juju_status['services']['nova-compute']['units'].iteritems():
- juju_compute_nodes[data['public-address']] = data
+if 'nova-compute' in juju_status['services']:
+ for name, data in juju_status['services']['nova-compute']['units'].iteritems():
+ juju_compute_nodes[data['public-address']] = data
print json.dumps({
"changed": True,
diff --git a/roles/juju-setup/templates/hosts.j2 b/roles/juju-setup/templates/hosts.j2
deleted file mode 100644
index ebc3706..0000000
--- a/roles/juju-setup/templates/hosts.j2
+++ /dev/null
@@ -1,10 +0,0 @@
-127.0.0.1 localhost
-127.0.1.1 ubuntu
-{% for host in vm_ip.results -%}
-{{ host.stdout }} {{ host.item.name }}
-{% endfor -%}
-
-# The following lines are desirable for IPv6 capable hosts
-::1 localhost ip6-localhost ip6-loopback
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters