Author: justi9
Date: 2007-10-10 09:59:38 -0400 (Wed, 10 Oct 2007)
New Revision: 995
Modified:
mgmt/cumin/python/cumin/demo.py
Log:
In demo data: adds vhost templates, adds non-clustered servers,
simplifies vhost names now that vhosts are properly scoped in the UI.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-10 13:49:24 UTC (rev 994)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-10 13:59:38 UTC (rev 995)
@@ -33,6 +33,13 @@
sgroups["Department"].add_child(sgroup)
sgroups[name] = sgroup
+ # vhost templates
+ for name in ("test", "devel"):
+ vhost = VirtualHost(self.model)
+ vhost.name = name
+
+ self.load_vhost(vhost)
+
clusters = list()
for cluster_count in range(3):
@@ -41,37 +48,37 @@
clusters.append(cluster)
vhost = VirtualHost(self.model)
- vhost.name = cluster.name + ".default"
+ vhost.name = "default"
vhost.set_cluster(cluster)
for name in ("test", "devel"):
vhost = VirtualHost(self.model)
- vhost.name = cluster.name + "." + name
+ vhost.name = name
vhost.set_cluster(cluster)
- for vhost in cluster.virtual_host_items():
self.load_vhost(vhost)
for server_count in range(12):
- cluster = clusters[server_count % 3]
-
server = Server(self.model)
server.name = fmt("server", server_count)
- server.set_cluster(cluster)
+ index = server_count % 4
+ if index < 3:
+ server.set_cluster(clusters[index])
+
if server_count % 2:
sgroups["East Coast"].add_server(server)
else:
sgroups["West Coast"].add_server(server)
vhost = VirtualHost(self.model)
- vhost.name = server.name + ".default"
+ vhost.name = "default"
vhost.set_server(server)
server.default_virtual_host = vhost
for name in ("test", "devel"):
vhost = VirtualHost(self.model)
- vhost.name = server.name + "." + name
+ vhost.name = name
vhost.set_server(server)
for vhost in server.virtual_host_items():