1214 |
1214 |
1215 # pyro handling ########################################################### |
1215 # pyro handling ########################################################### |
1216 |
1216 |
1217 def pyro_register(self, host=''): |
1217 def pyro_register(self, host=''): |
1218 """register the repository as a pyro object""" |
1218 """register the repository as a pyro object""" |
1219 import tempfile |
1219 from logilab.common import pyro_ext as pyro |
1220 from logilab.common.pyro_ext import register_object, config |
1220 config = self.config |
1221 config.PYRO_STORAGE = tempfile.gettempdir() # XXX until lgc > 0.45.1 is out |
1221 appid = '%s.%s' % pyro.ns_group_and_id( |
1222 appid = self.config['pyro-instance-id'] or self.config.appid |
1222 config['pyro-instance-id'] or config.appid, |
1223 daemon = register_object(self, appid, self.config['pyro-ns-group'], |
1223 config['pyro-ns-group']) |
1224 self.config['pyro-host'], |
1224 # ensure config['pyro-instance-id'] is a full qualified pyro name |
1225 self.config['pyro-ns-host']) |
1225 config['pyro-instance-id'] = appid |
1226 msg = 'repository registered as a pyro object using group %s and id %s' |
1226 daemon = pyro.register_object(self, appid, |
1227 self.info(msg, self.config['pyro-ns-group'], appid) |
1227 daemonhost=config['pyro-host'], |
|
1228 nshost=config['pyro-ns-host']) |
|
1229 self.info('repository registered as a pyro object %s', appid) |
1228 self.pyro_registered = True |
1230 self.pyro_registered = True |
1229 return daemon |
1231 return daemon |
1230 |
1232 |
1231 # multi-sources planner helpers ########################################### |
1233 # multi-sources planner helpers ########################################### |
1232 |
1234 |