Author: justi9
Date: 2007-10-15 17:13:51 -0400 (Mon, 15 Oct 2007)
New Revision: 1078
Modified:
mgmt/cumin/python/cumin/demo.py
Log:
Adds server profiles to the demo data.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-15 20:57:52 UTC (rev 1077)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-15 21:13:51 UTC (rev 1078)
@@ -34,6 +34,15 @@
sgroup.set_type(sgtypes["Department"])
sgroups[name] = sgroup
+ sprofiles = list()
+
+ for name in ("4S Xserve", "2S ProLiant"):
+ sprofile = ServerProfile(self.model)
+ sprofile.name = name
+ sprofiles.append(sprofile)
+
+ self.load_props(sprofile)
+
# vhost templates
for name in ("test", "devel"):
vhost = VirtualHost(self.model)
@@ -63,25 +72,16 @@
server = Server(self.model)
server.name = fmt("server", server_count)
- prop = ConfigProperty(self.model)
- prop.name = "max_threads"
- prop.value = 1000
- server.add_config_property(prop)
+ self.load_props(server)
- prop = ConfigProperty(self.model)
- prop.name = "max_memory"
- prop.value = 1000000
- server.add_config_property(prop)
-
- prop = ConfigProperty(self.model)
- prop.name = "ssl_enabled"
- prop.value = True
- server.add_config_property(prop)
-
index = server_count % 4
if index < 3:
server.set_cluster(clusters[index])
+ index = server_count % 3
+ if index < 2:
+ server.set_server_profile(sprofiles[index])
+
if server_count % 2:
sgroups["East Coast"].add_server(server)
else:
@@ -105,6 +105,22 @@
for vhost in server.virtual_host_items():
self.load_vhost(vhost)
+ def load_props(self, obj):
+ prop = ConfigProperty(self.model)
+ prop.name = "max_threads"
+ prop.value = 1000
+ obj.add_config_property(prop)
+
+ prop = ConfigProperty(self.model)
+ prop.name = "max_memory"
+ prop.value = 1000000
+ obj.add_config_property(prop)
+
+ prop = ConfigProperty(self.model)
+ prop.name = "ssl_enabled"
+ prop.value = True
+ obj.add_config_property(prop)
+
def load_vhost(self, vhost):
for name in ("realm0", "realm1", "realm2"):
realm = Realm(self.model)
Show replies by date