convert hostnames to lowercase when adding to data model
diff --git a/planetstack/openstack_observer/steps/sync_nodes.py b/planetstack/openstack_observer/steps/sync_nodes.py
index d648b7d..1c1096c 100644
--- a/planetstack/openstack_observer/steps/sync_nodes.py
+++ b/planetstack/openstack_observer/steps/sync_nodes.py
@@ -38,11 +38,12 @@
continue
for compute_node in compute_nodes:
- if compute_node.hypervisor_hostname not in node_hostnames:
+ hostname = compute_node.hypervisor_hostname.lower()
+ if hostname not in node_hostnames:
# XX TODO:figure out how to correctly identify a node's site.
# XX pick a random site to add the node to for now
site_index = random.randint(0, len(sites))
- node = Node(name=compute_node.hypervisor_hostname,
+ node = Node(name=hostname,
site=sites[site_index], deployment=deployment)
new_nodes.append(node)