| 69 | |
| 70 | |
| 71 | def startBackends(self): |
| 72 | host = self.core.config["remote"]["listenaddr"] |
| 73 | port = self.core.config["remote"]["port"] |
| 74 | |
| 75 | for b in self.available: |
| 76 | klass = getattr(__import__("module.remote.%s" % b, globals(), locals(), [b], -1), b) |
| 77 | backend = klass(self) |
| 78 | if not backend.checkDeps(): |
| 79 | continue |
| 80 | try: |
| 81 | backend.setup(host, port) |
| 82 | self.core.log.info(_("Starting %(name)s: %(addr)s:%(port)s") % {"name": b, "addr": host, "port": port}) |
| 83 | except Exception, e: |
| 84 | self.core.log.error(_("Failed loading backend %(name)s | %(error)s") % {"name": b, "error": str(e)}) |
| 85 | if self.core.debug: |
| 86 | print_exc() |
| 87 | else: |
| 88 | backend.start() |
| 89 | self.backends.append(backend) |
| 90 | |
| 91 | port += 1 |