Something wrong with the ssh commands./
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 21s
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 21s
This commit is contained in:
parent
df03f5ef91
commit
23e3d731c9
@ -121,7 +121,7 @@ sCommand server_env_manager::construct_standard_template_run_cmd(const std::stri
|
||||
argstr += " " + quote(dequote(trim(arg)));
|
||||
}
|
||||
|
||||
sCommand scommand(remote_service_template_path, "bash " + quote(script_path) + argstr + (silent ? " > /dev/null 2>&1" : ""), env_vars);
|
||||
sCommand scommand(remote_service_template_path, quote(script_path) + argstr + (silent ? " > /dev/null 2>&1" : ""), env_vars);
|
||||
|
||||
if (scommand.empty())
|
||||
std::cerr << "Error: Failed to construct command for " << service_name << " " << command << std::endl;
|
||||
@ -184,7 +184,7 @@ bool server_env_manager::remove_remote_dir(const std::string &dir_path, bool sil
|
||||
|
||||
sCommand scommand(remote_cmd);
|
||||
cMode mode = (silent ? cMode::Silent : cMode::None);
|
||||
|
||||
|
||||
return execute_ssh_command(get_SSH_INFO(), scommand, mode);
|
||||
}
|
||||
|
||||
|
@ -110,8 +110,6 @@ bool execute_ssh_command(const sSSHInfo &ssh_info, const sCommand &command, cMod
|
||||
<< ssh_info.user << "@" << ssh_info.host;
|
||||
|
||||
std::string cmdstr = command.construct_cmd(is_raw(mode) ? cStyle::Raw : cStyle::Safe);
|
||||
ASSERT(cmdstr.find("'") == std::string::npos, "Raw command must not contain single quotes: " + cmdstr);
|
||||
cmdstr = "bash -c " + halfquote(cmdstr);
|
||||
sCommand ssh_command(ssh_cmd.str() + " " + cmdstr);
|
||||
|
||||
cMode localmode = mode + cMode::RawCommand;
|
||||
@ -141,15 +139,18 @@ std::string sCommand::construct_cmd(cStyle style) const
|
||||
return "";
|
||||
|
||||
std::string cmdstr;
|
||||
if (!mDir.empty())
|
||||
cmdstr = "cd " + quote(mDir) + " && ";
|
||||
|
||||
for (const auto& env_var : mVars) {
|
||||
cmdstr += env_var.first + "=" + quote(dequote(trim(env_var.second))) + " ";
|
||||
}
|
||||
|
||||
cmdstr += "bash -c '";
|
||||
if (!mDir.empty())
|
||||
cmdstr += "cd " + quote(mDir) + " && ";
|
||||
|
||||
cmdstr += mCmd;
|
||||
|
||||
cmdstr += "'";
|
||||
|
||||
if (is_safe(style))
|
||||
cmdstr = makesafecmd(cmdstr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user