def connect(self, machine_env, host, machine_config_file): """ Connect service composer to machine layer. """ self.machine_env = machine_env self.machine_host = host with open(machine_config_file, 'r') as f: self.machine_config = json.load(f) try: self.docker_client = Client(**docker_env(assert_hostname=False, environment=self.machine_env)) self._connected = ComposerState.CONNECTED except Exception: raise Two1ComposerConnectedException()
def connect(self, machine_env, host, machine_config_file): """ Connect service composer to machine layer. Args: machine_env (dict): Environment dictionary for the docker client of the machine layer. host (str): Hostname of the machine layer docker daemon. machine_config_file (str): Path to the config file for the machine layer. """ self.machine_env = machine_env self.machine_host = host with open(machine_config_file, 'r') as f: self.machine_config = json.load(f) self.docker_client = Client(**docker_env(assert_hostname=False, environment=self.machine_env)) self._connected = ComposerState.CONNECTED
def connect(self, machine_env, host, machine_config_file): """ Connect service composer to machine layer. Args: machine_env (dict): Environment dictionary for the docker client of the machine layer host: Hostname of the machine layer docker daemon machine_config_file (str): Path to the config file for the machine layer """ self.machine_env = machine_env self.machine_host = host with open(machine_config_file, 'r') as f: self.machine_config = json.load(f) self.docker_client = Client(**docker_env(assert_hostname=False, environment=self.machine_env)) self._connected = ComposerState.CONNECTED