public void execute(DelegateExecution ctx) throws Exception {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("remotefilename");
String srcdir=(String)ctx.getVariable("srcdir");
String destdir=(String)ctx.getVariable("destdir");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,srcdir,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,srcdir,destdir);
String command="cd "+destdir+ ";" +" ./"+filename+" "+ (fileparams!=null?fileparams:" ") ;
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,command);
}
}
int waittime=(Integer)ctx.getVariable("waittime");
int iterations=(Integer)ctx.getVariable("iterations");
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String srcdir=(String)ctx.getVariable("srcdir");
String destdir=(String)ctx.getVariable("destdir");
String filepparams=(String)ctx.getVariable("verifierfileparams");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} , waittime : {},No of iterations :{}",
- remoteserver,portnumber,username,password,verifierFilename,srcdir,destdir,waittime,iterations);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} , waittime : {},No of iterations :{}",
+ remoteserver,port,username,password,verifierFilename,srcdir,destdir,waittime,iterations);
String command= "cd "+destdir+ ";" + (filepparams!=null?filepparams:" ") + " ./"+verifierFilename;
logger.debug("Execution command {}",command);
- remotedeploymentVerificationService.executeScript(remoteserver,username,password,portnumber,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command);
+ remotedeploymentVerificationService.executeScript(remoteserver,username,password,port,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command);
}catch(TaskExecutorException ex) {
throw ex;
}
public void execute(DelegateExecution ctx) throws Exception {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("filename");
String destdir=(String)ctx.getVariable("destdir");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,srcdir,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,srcdir,destdir);
String command= "cd "+destdir+ ";" + (fileparams!=null?fileparams:" ") + " ./"+filename;
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,command);
}
}
try {
String remoteserver =(String) ctx.getVariable("remoteserver");
- int portnumber =(Integer)ctx.getVariable("port");
+ int port =(Integer)ctx.getVariable("port");
String username =(String) ctx.getVariable("username");
String password =(String) ctx.getVariable("password");
String filename =(String) ctx.getVariable("postverificationscript");
String blueprint =(String) ctx.getVariable("blueprint");
deployResponseSenderService.sendResponse(new BuildResponse(null, null, null, null, "completed", sitename, null, null, null));
- logger.debug("task execution started blueprint {}, remoteserver {}, portnumber {}, username {}, password {}, filename {}, fileparams {}, src dir={}, dest dir={}",
- blueprint, remoteserver, portnumber, username, password, filename, fileparams, srcdir, destdir);
+ logger.debug("task execution started blueprint {}, remoteserver {}, port {}, username {}, password {}, filename {}, fileparams {}, src dir={}, dest dir={}",
+ blueprint, remoteserver, port, username, password, filename, fileparams, srcdir, destdir);
String command = String.format("/bin/bash %s/%s %s", destdir, filename, (fileparams!=null?fileparams.replaceAll(",", " "):""));
if ( filename != null && !filename.equals("null") && !filename.isEmpty() ) {
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,command);
} else {
logger.debug("Skipping invalid verification command: {}", command);
}
try {
String remoteserver =(String) ctx.getVariable("remoteserver");
- int portnumber =(Integer)ctx.getVariable("port");
+ int port =(Integer)ctx.getVariable("port");
String username =(String) ctx.getVariable("username");
String password =(String) ctx.getVariable("password");
String filename =(String) ctx.getVariable("verifier");
deployResponseSenderService.sendResponse(new BuildResponse(null, null, null, null, "verifying...", sitename,null,null,null));
- logger.debug("task execution started blueprint {}, remoteserver {}, portnumber {}, username {}, password {}, filename {}, waittime {}, No of iterations {}",
- blueprint, remoteserver, portnumber, username, password, filename, waittime, iterations);
+ logger.debug("task execution started blueprint {}, remoteserver {}, port {}, username {}, password {}, filename {}, waittime {}, No of iterations {}",
+ blueprint, remoteserver, port, username, password, filename, waittime, iterations);
String command = String.format("/bin/bash %s/%s %s", destdir, filename, (fileparams!=null?fileparams.replaceAll(",", " "):""));
if ( filename != null && !filename.equals("null") && !filename.isEmpty() ) {
logger.debug("Execution command: {}",command);
- remotedeploymentVerificationService.executeScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,waittime,iterations,command);
+ remotedeploymentVerificationService.executeScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,waittime,iterations,command);
} else {
logger.debug("Skipping invalid verification command: {}", command);
}
public void execute(DelegateExecution ctx) throws Exception {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("filename");
String sitename=(String)ctx.getVariable("sitename");
deployResponseSenderService.sendResponse(new BuildResponse(null, null, null, null, "in progress...", sitename, null, null, null));
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,srcdir,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,srcdir,destdir);
String command = String.format("/bin/bash %s/%s %s", destdir, filename, (fileparams!=null?fileparams.replaceAll(",", " "):""));
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,command);
}
}
String srcdir=(String)ctx.getVariable("srcdir");
String destdir=(String)ctx.getVariable("destdir");
- logger.debug("File transfer started remoteserver {} , portnumber {},username {}, password {},src ={}, dest={}",
+ logger.debug("File transfer started remoteserver {} , port {},username {}, password {},src ={}, dest={}",
remoteserver,port,username,password,srcdir,destdir);
fileTransferService.transferFile(srcdir, destdir,remoteserver, username, password, port);
}catch(TaskExecutorException ex) {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("remotefile1");
String fileparams=(String)ctx.getVariable("remotefile1params");
String destdir=(String)ctx.getVariable("destdir1");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,destdir);
String command="cd "+destdir+ ";" +" bash "+filename+" "+ (fileparams!=null?fileparams:" ") ;
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,null,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,null,destdir,command);
}
}
public void execute(DelegateExecution ctx) throws Exception {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("remotefile2");
deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "inprogress","not started",sitename,null,null,null));
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,destdir);
String command="cd "+destdir+ ";" +" bash "+filename+" "+ (fileparams!=null?fileparams:" ") ;
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,null,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,null,destdir,command);
deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "completed","completed",sitename,null,null,null));
}
int waittime=(Integer)ctx.getVariable("waittime");
int iterations=(Integer)ctx.getVariable("iterations");
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String srcdir=(String)ctx.getVariable("srcdir");
String destdir=(String)ctx.getVariable("destdir");
String filepparams=(String)ctx.getVariable("verifierfileparams");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} , waittime : {},No of iterations :{}",
- remoteserver,portnumber,username,password,verifierFilename,srcdir,destdir,waittime,iterations);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} , waittime : {},No of iterations :{}",
+ remoteserver,port,username,password,verifierFilename,srcdir,destdir,waittime,iterations);
// This looks wrong!
String command = "/bin/bash " +destdir+"/"+(verifierFilename!=null?verifierFilename:" ")+" "+(filepparams!=null?filepparams.replaceAll(",", " "):" ");
logger.debug("Execution command {}",command);
- remotedeploymentVerificationService.executeScript(remoteserver,username,password,portnumber,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command);
+ remotedeploymentVerificationService.executeScript(remoteserver,username,password,port,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command);
} catch(TaskExecutorException ex) {
throw ex;
}
public void execute(DelegateExecution ctx) throws Exception {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("filename");
String srcdir=(String)ctx.getVariable("srcdir");
String destdir=(String)ctx.getVariable("destdir");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,srcdir,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,srcdir,destdir);
String command = String.format("cd %s; /bin/bash %s %s", destdir, filename, (fileparams!=null?fileparams.replaceAll(",", " "):""));
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,command);
}
}
int waittime=(Integer)ctx.getVariable("waittime");
int iterations=(Integer)ctx.getVariable("iterations");
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String srcdir=(String)ctx.getVariable("srcdir");
String destdir=(String)ctx.getVariable("destdir");
String filepparams=(String)ctx.getVariable("verifierfileparams");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} , waittime : {},No of iterations :{}",
- remoteserver,portnumber,username,password,verifierFilename,srcdir,destdir,waittime,iterations);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} , waittime : {},No of iterations :{}",
+ remoteserver,port,username,password,verifierFilename,srcdir,destdir,waittime,iterations);
String command= "cd "+destdir+ ";" + (filepparams!=null?filepparams:" ")+ " ./"+verifierFilename;
logger.debug("Execution command {}",command);
- remotedeploymentVerificationService.executeScript(remoteserver,username,password,portnumber,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command);
+ remotedeploymentVerificationService.executeScript(remoteserver,username,password,port,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command);
}catch(TaskExecutorException ex) {
throw ex;
}
public void execute(DelegateExecution ctx) throws Exception {
String remoteserver=(String)ctx.getVariable("remoteserver");
- int portnumber=(Integer)ctx.getVariable("port");
+ int port=(Integer)ctx.getVariable("port");
String username=(String)ctx.getVariable("username");
String password=(String)ctx.getVariable("password");
String filename=(String)ctx.getVariable("filename");
String destdir=(String)ctx.getVariable("destdir");
- logger.debug("task execution started remoteserver {} , portnumber {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
- remoteserver,portnumber,username,password,filename,fileparams,srcdir,destdir);
+ logger.debug("task execution started remoteserver {} , port {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}",
+ remoteserver,port,username,password,filename,fileparams,srcdir,destdir);
String command= "cd "+destdir+ ";" + (fileparams!=null?fileparams:" ") + " ./"+filename;
logger.debug("Execution command {}",command);
- remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,portnumber,filename,fileparams,srcdir,destdir,command);
+ remoteScriptExecutionService.executeRemoteScript(remoteserver,username,password,port,filename,fileparams,srcdir,destdir,command);
}
}
private String remoteserver;
private String username;
private String password;
- private int portnumber;
+ private int port;
private String srcdir;
private String destdir;
private String filename;
}
- public int getPortnumber() {
- return portnumber;
+ public int getPort() {
+ return port;
}
- public void setPortnumber(int portnumber) {
- this.portnumber = portnumber;
+ public void setPort(int port) {
+ this.port = port;
}
@Override
public String toString() {
return "Apache [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username
- + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir="
+ + ", password=" + password + ", port=" + port + ", srcdir=" + srcdir + ", destdir="
+ destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier="
+ deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations
+ ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams="
private String remoteserver;
private String username;
private String password;
- private int portnumber;
+ private int port;
private String srcdir;
private String destdir;
private String filename;
}
- public int getPortnumber() {
- return portnumber;
+ public int getPort() {
+ return port;
}
- public void setPortnumber(int portnumber) {
- this.portnumber = portnumber;
+ public void setPort(int port) {
+ this.port = port;
}
@Override
public String toString() {
return "Onap [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username
- + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir="
+ + ", password=" + password + ", port=" + port + ", srcdir=" + srcdir + ", destdir="
+ destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier="
+ deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations
+ ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams="
private String remoteserver;
private String username;
private String password;
- private int portnumber;
+ private int port;
private String srcdir;
private String destdir;
private String filename;
}
- public int getPortnumber() {
- return portnumber;
+ public int getPort() {
+ return port;
}
- public void setPortnumber(int portnumber) {
- this.portnumber = portnumber;
+ public void setPort(int port) {
+ this.port = port;
}
@Override
public String toString() {
return "Tempest [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username
- + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir="
+ + ", password=" + password + ", port=" + port + ", srcdir=" + srcdir + ", destdir="
+ destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier="
+ deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations
+ ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams="
public interface RemoteDeploymentVerificationService {
- public void executeScript(String remoteserver,String username,String password,int portnumber,String filename,
+ public void executeScript(String remoteserver,String username,String password,int port,String filename,
String fileparams,String srcdir,String destdir,int waittime,int iterations,String command);
public interface RemoteScriptExecutionService {
- public void executeRemoteScript(String remoteserver,String username,String password,int portnumber,String filename,String fileparams,String srcdir,String destdir,String command);
+ public void executeRemoteScript(String remoteserver,String username,String password,int port,String filename,String fileparams,String srcdir,String destdir,String command);
}
.putValue("remoteserver", onap.getRemoteserver())
.putValue("username", onap.getUsername())
.putValue("password", onap.getPassword())
- .putValue("port", onap.getPortnumber())
+ .putValue("port", onap.getPort())
.putValue("srcdir", onap.getSrcdir())
.putValue("destdir",onap.getDestdir())
.putValue("ScpScriptFilepath", transferfile)
.putValue("remoteserver", tempest.getRemoteserver())
.putValue("username", tempest.getUsername())
.putValue("password", tempest.getPassword())
- .putValue("port", tempest.getPortnumber())
+ .putValue("port", tempest.getPort())
.putValue("srcdir", tempest.getSrcdir())
.putValue("destdir",tempest.getDestdir())
.putValue("ScpScriptFilepath", transferfile)
.putValue("remoteserver", apache.getRemoteserver())
.putValue("username", apache.getUsername())
.putValue("password", apache.getPassword())
- .putValue("port", apache.getPortnumber())
+ .putValue("port", apache.getPort())
.putValue("srcdir", apache.getSrcdir())
.putValue("destdir",apache.getDestdir())
.putValue("scpfilename", transferfile)
private static Logger logger = LoggerFactory.getLogger(RemoteDeploymentverificationServiceImpl.class);
- public void executeScript(String remoteserver,String username,String password,int portnumber,
+ public void executeScript(String remoteserver,String username,String password,int port,
String filename,String fileparams,String srcdir,String destdir,int waitttime,int iterations,String command) {
boolean issuccess=true;
logger.debug("Executing the deployment verification script: {} iteration: {}", command, i);
Thread.sleep(waitttime*1000);
JSch jsch = new JSch();
- session = jsch.getSession(username, remoteserver, portnumber);
+ session = jsch.getSession(username, remoteserver, port);
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword(password);
session.connect();
* @param remoteserver the remote server to execute on
* @param username the user name on the remote server
* @param password the password for the user
- * @param portnumber the port number on the remote server
+ * @param port the port number on the remote server
* @param filename not used
* @param fileparams not used
* @param srcdir not used
* @param destdir not used
* @param command the command to execute
*/
- public void executeRemoteScript(String remoteserver,String username,String password,int portnumber,String filename,
+ public void executeRemoteScript(String remoteserver,String username,String password,int port,String filename,
String fileparams,String srcdir,String destdir,String command) {
//String filepath=destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" ");
Session session=null;
BufferedReader reader =null;
try {
- //tranferFile(remoteserver,portnumber,username,password,filename,srcdir,destdir);
+ //tranferFile(remoteserver,port,username,password,filename,srcdir,destdir);
logger.debug("executing the script "+command);
JSch jsch = new JSch();
- session = jsch.getSession(username, remoteserver, portnumber);
+ session = jsch.getSession(username, remoteserver, port);
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword(password);
session.connect();