def start_master_nodes(masters, cl_args):
pids = []<EOL>for master in masters:<EOL><INDENT>Log.info("<STR_LIT>" % master)<EOL>cmd = "<STR_LIT>"% (get_nomad_path(cl_args), get_nomad_master_config_file(cl_args))<EOL>if not is_self(master):<EOL><INDENT>cmd = ssh_remote_execute(cmd, master, cl_args)<EOL><DEDENT>Log.debug(cmd)<EOL>pid = subprocess.Popen(cmd,<EOL>shell=True,<EOL>stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE)<EOL>pids.append({"<STR_LIT>": pid, "<STR_LIT>": master})<EOL><DEDENT>errors = []<EOL>for entry in pids:<EOL><INDENT>pid = entry["<STR_LIT>"]<EOL>return_code = pid.wait()<EOL>output = pid.communicate()<EOL>Log.debug("<STR_LIT>" % (return_code, output))<EOL>if return_code != <NUM_LIT:0>:<EOL><INDENT>errors.append("<STR_LIT>" % (entry["<STR_LIT>"], output[<NUM_LIT:1>]))<EOL><DEDENT><DEDENT>if errors:<EOL><INDENT>for error in errors:<EOL><INDENT>Log.error(error)<EOL><DEDENT>sys.exit(-<NUM_LIT:1>)<EOL><DEDENT>Log.info("<STR_LIT>")<EOL>
Start master nodes