예제 #1
0
 def Ask(self, cmd):
     self.access_semaphor.acquire()
     try:
         reply = SimpleSocket.Ask(self, cmd)
     except:
         print 'Exception occured! Retrying in 10 seconds',time.sleep(10)
         reply = SimpleSocket.Ask(self, cmd)
     
     self.access_semaphor.release()
     debug(self,'[Ask] for command %s Resopnse  %s' % (cmd, reply))
     return reply
예제 #2
0
 def __init__(self, hostname, port = 22611):
     SimpleSocket.__init__(self, hostname = hostname, port = port)
     SimpleSocket.set_keepalives(self)
     self.access_semaphor = threading.Semaphore(1)
예제 #3
0
 def Ask(self, cmd):
     self.access_semaphor.acquire()
     reply = SimpleSocket.Ask(self, cmd).strip('\n')
     self.access_semaphor.release()
     return reply
예제 #4
0
 def SendCommand(self, cmd):
     self.access_semaphor.acquire()
     print "Sending command: " + cmd
     SimpleSocket.SendCommand(self, cmd)
     self.access_semaphor.release()
예제 #5
0
 def __init__(self, hostname, port=22611):
     SimpleSocket.__init__(self, hostname=hostname, port=port)
     SimpleSocket.set_keepalives(self)
     self.access_semaphor = threading.Semaphore(1)
예제 #6
0
 def SendCommand(self, cmd):
     self.access_semaphor.acquire()
     SimpleSocket.SendCommand(self, cmd)
     self.access_semaphor.release()
예제 #7
0
 def __init__(self, hostname, port = int(xena_chassis_config.xena_socket_port)):
     SimpleSocket.__init__(self, hostname = hostname, port = port)
     SimpleSocket.set_keepalives(self)
     self.access_semaphor = threading.Semaphore(1)