def add_agent_manager(self, config_file=None, common_cfg=None, timeout=15): """Add a new daos agent manager object to the agent manager list. Args: config_file (str, optional): daos agent config file name. Defaults to None, which will use a default file name. common_cfg (CommonConfig, optional): daos agent config file settings shared between the agent and server. Defaults to None, which uses the class CommonConfig. timeout (int, optional): number of seconds to wait for the daos agent to start before reporting an error. Defaults to 60. """ self.log.info("--- ADDING AGENT MANAGER ---") # Setup defaults if config_file is None: config_file = self.get_config_file("daos", "agent") if common_cfg is None: agent_transport = DaosAgentTransportCredentials(self.workdir) common_cfg = CommonConfig(self.server_group, agent_transport) # Create an AgentCommand to manage with a new AgentManager object agent_cfg = DaosAgentYamlParameters(config_file, common_cfg) agent_cmd = DaosAgentCommand(self.bin, agent_cfg, timeout) self.agent_managers.append( DaosAgentManager(agent_cmd, self.manager_class))
def get_agent_command(group, cert_dir, bin_dir, config_file, config_temp=None): """Get the daos_agent command object to manage. Args: group (str): daos_server group name cert_dir (str): directory in which to copy certificates bin_dir (str): location of the daos_server executable config_file (str): configuration file name and path config_temp (str, optional): file name and path to use to generate the configuration file locally and then copy it to all the hosts using the config_file specification. Defaults to None, which creates and utilizes the file specified by config_file. Returns: DaosServerCommand: the daos_server command object """ transport_config = DaosAgentTransportCredentials(cert_dir) common_config = CommonConfig(group, transport_config) config = DaosAgentYamlParameters(config_file, common_config) command = DaosAgentCommand(bin_dir, config) if config_temp: # Setup the DaosAgentCommand to write the config file data to the # temporary file and then copy the file to all the hosts using the # assigned filename command.temporary_file = config_temp return command