Example #1
0
 def _init_writer(self, ssh, cert_paths):
     cmdline = ("%(cmd)s run -ca-cert %(ca_cert)s -key "
                "%(srv_key)s -cert %(srv_cert)s -listen-port "
                "%(listen_port)s") % {
                    "cmd": self._writer_cmd,
                    "ca_cert": cert_paths["ca_crt"],
                    "srv_key": cert_paths["srv_key"],
                    "srv_cert": cert_paths["srv_crt"],
                    "listen_port": self._writer_port,
         }
     utils.create_service(
         ssh, cmdline, _CORIOLIS_HTTP_WRITER_CMD, start=True)
     self._inject_iptables_allow(ssh)
Example #2
0
 def _exec_replicator(self, ssh, port, certs, state_file):
     cmdline = ("%(replicator_path)s run -hash-method=%(hash_method)s "
                "-ignore-mounted-disks=%(ignore_mounted)s "
                "-listen-port=%(listen_port)s "
                "-chunk-size=%(chunk_size)s "
                "-watch-devices=%(watch_devs)s "
                "-state-file=%(state_file)s "
                "-ca-cert=%(ca_cert)s -cert=%(srv_cert)s "
                "-key=%(srv_key)s" % {
                    "replicator_path": REPLICATOR_PATH,
                    "hash_method": self._hash_method,
                    "ignore_mounted": json.dumps(self._ignore_mounted),
                    "watch_devs": json.dumps(self._watch_devices),
                    "listen_port": str(port),
                    "state_file": state_file,
                    "chunk_size": self._chunk_size,
                    "ca_cert": certs["ca_crt"],
                    "srv_cert": certs["srv_crt"],
                    "srv_key": certs["srv_key"],
                })
     utils.create_service(
         ssh, cmdline, REPLICATOR_SVC_NAME,
         run_as=REPLICATOR_USERNAME)