Author: rschloming
Date: 2008-04-22 12:13:02 -0400 (Tue, 22 Apr 2008)
New Revision: 1953
Modified:
mgmt/basil/python/basil/__init__.py
mgmt/mint/python/mint/__init__.py
Log:
updated to use 0-10 final
Modified: mgmt/basil/python/basil/__init__.py
===================================================================
--- mgmt/basil/python/basil/__init__.py 2008-04-22 00:55:28 UTC (rev 1952)
+++ mgmt/basil/python/basil/__init__.py 2008-04-22 16:13:02 UTC (rev 1953)
@@ -1,6 +1,8 @@
-import mllib, qpid, new
+import mllib, qpid, new, uuid
from string import Template
from qpid.management import managementChannel, managementClient
+from qpid.util import connect
+from qpid.connection import Connection
from threading import Lock
from util import *
@@ -115,7 +117,7 @@
attrs["basil_model"] = self.package.model
attrs["basil_package"] = self.package
attrs["basil_class"] = self
- self.python_class = type(name, (BasilObject,), attrs)
+ self.python_class = type(str(name), (BasilObject,), attrs)
def on_schema(self, context_id, class_info,
configs, metrics, methods, events):
@@ -198,7 +200,7 @@
self.port = port
self.context_id = "%s:%i" % (self.host, self.port)
- self.client = qpid.client.Client(host, port, self.model.spec)
+ self.conn = Connection(connect(host, port), self.model.spec)
self.mclient = managementClient(self.model.spec,
None,
@@ -212,9 +214,9 @@
self.model.connections[self.context_id] = self
def open(self):
- self.client.start({})
+ self.conn.start()
self.chan = self.mclient.addChannel \
- (self.client.channel(1), self.context_id)
+ (self.conn.session(str(uuid.uuid4())), self.context_id)
def close(self):
self.mclient.removeChannel(self.chan)
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-04-22 00:55:28 UTC (rev 1952)
+++ mgmt/mint/python/mint/__init__.py 2008-04-22 16:13:02 UTC (rev 1953)
@@ -1,4 +1,6 @@
-import os, socket, qpid, logging
+import os, socket, qpid, logging, uuid
+from qpid.connection import Connection
+from qpid.util import connect
from qpid.management import managementChannel, managementClient
from datetime import *
from sqlobject import *
@@ -170,7 +172,7 @@
self.objs = OriginalIdDict()
spec = qpid.spec.load(model.specPath)
- self.client = qpid.client.Client(host, port, spec)
+ self.conn = Connection(connect(host, port), spec)
self.mclient = managementClient(spec, None,
self.model.configCallback,
self.model.instCallback,
@@ -194,8 +196,8 @@
# dict
self.model.connections[self.key] = self
- self.client.start({})
- self.mchan = self.mclient.addChannel (self.client.channel(1), self.key)
+ self.conn.start()
+ self.mchan = self.mclient.addChannel (self.conn.session(str(uuid.uuid4())),
self.key)
self.state = "opened"
except Exception, e: