not creating new handle if the current thread already has one. changed resource...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 19 Aug 2007 01:33:21 +0000 (01:33 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 19 Aug 2007 01:33:21 +0000 (01:33 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1082 9efc2488-bf62-4759-914b-345cdb29e865

src/python/osrf/net.py
src/python/osrf/system.py

index 7db4fe7..85afe47 100644 (file)
@@ -70,7 +70,7 @@ class osrfNetwork(JabberClient):
         self.isconnected = False
 
         # Create a unique jabber resource
-        resource = 'python_'
+        resource = 'python'
         if args.has_key('resource'):
             resource = args['resource']
         resource += '_' + gethostname()+':'+ str(os.getpid()) + '_'+ threading.currentThread().getName().lower()
index 94ad907..362fdd0 100644 (file)
@@ -24,6 +24,10 @@ import sys
 def osrfConnect(configFile, configContext):
     """ Connects to the opensrf network """
 
+    if osrfGetNetworkHandle():
+        ''' This thread already has a handle '''
+        return
+
     # parse the config file
     configParser = osrfConfig(configFile, configContext)
     configParser.parseConfig()