1225 |
1225 |
1226 # pyro handling ########################################################### |
1226 # pyro handling ########################################################### |
1227 |
1227 |
1228 def pyro_register(self, host=''): |
1228 def pyro_register(self, host=''): |
1229 """register the repository as a pyro object""" |
1229 """register the repository as a pyro object""" |
1230 import tempfile |
1230 from logilab.common import pyro_ext as pyro |
1231 from logilab.common.pyro_ext import register_object, config |
1231 config = self.config |
1232 config.PYRO_STORAGE = tempfile.gettempdir() # XXX until lgc > 0.45.1 is out |
1232 appid = '%s.%s' % pyro.ns_group_and_id( |
1233 appid = self.config['pyro-instance-id'] or self.config.appid |
1233 config['pyro-instance-id'] or config.appid, |
1234 daemon = register_object(self, appid, self.config['pyro-ns-group'], |
1234 config['pyro-ns-group']) |
1235 self.config['pyro-host'], |
1235 # ensure config['pyro-instance-id'] is a full qualified pyro name |
1236 self.config['pyro-ns-host']) |
1236 config['pyro-instance-id'] = appid |
1237 msg = 'repository registered as a pyro object using group %s and id %s' |
1237 daemon = pyro.register_object(self, appid, |
1238 self.info(msg, self.config['pyro-ns-group'], appid) |
1238 daemonhost=config['pyro-host'], |
|
1239 nshost=config['pyro-ns-host']) |
|
1240 self.info('repository registered as a pyro object %s', appid) |
1239 self.pyro_registered = True |
1241 self.pyro_registered = True |
1240 return daemon |
1242 return daemon |
1241 |
1243 |
1242 # multi-sources planner helpers ########################################### |
1244 # multi-sources planner helpers ########################################### |
1243 |
1245 |