コード例 #1
0
 def setUp(self):
     self.server = RPCNotificationTestServer(endpoint=self.endpoint,
                                             logger=self.logger)
     self.server.daemon = True
     self.server.start()
     self.client = jsonrpc2_zeromq.RPCNotifierClient(endpoint=self.endpoint,
                                                     logger=self.logger)
コード例 #2
0
ファイル: tansit.py プロジェクト: madebymany/brak-web
def promote(endpoint, promotion_req):
    c = jsonrpc2_zeromq.RPCNotifierClient(endpoint, timeout=120 * 1000)
    r = promotion_req
    try:
        return True, c.copy(package=r.package_name,
                            to_codename=r.to_codename,
                            to_component=r.component,
                            codename=r.from_codename,
                            component=r.component,
                            versions=[r.version],
                            cache_control="max-age=0",
                            preserve_versions=True,
                            bucket=r.bucket,
                            arch=r.arch)
    except jsonrpc2_zeromq.RPCError as e:
        return False, e.error_msg