24 from clm.models.cluster
import Cluster
25 from clm.utils.exception
import CLMException
26 from common.utils
import ServerProxy
27 from clm.utils
import message
41 self.
server = ServerProxy(
'http://%s:%s' % (self.cluster.address, self.cluster.port))
48 resp = self.server.send_request(*args, **kw)
49 if resp[
'status'] !=
'ok':
50 raise CLMException(resp[
'status'])
51 if 'messages' in resp:
52 for user_id, msgs
in resp[
'messages'].iteritems():
54 msg[
'cm_id'] = self.cluster.id
55 message.add(user_id, msg)