Esempio n. 1
0
 def build(self):
     self.trigger('source-build-before')
     #ret=run.script_execute(self.script,[],self.cwd)
     if not self.host or self.host == "127.0.0.1":
         stdout,stderr=run.execute_helper(self.script,[],self.cwd)
     else:
         client = ssh.SSHUtil(self.host,self.username,self.password)
         stdout,stderr=client.execute_lines([self.script],cwd=self.cwd)
     self.trigger('source-build-after')
     if stderr:
         LOG.error(stderr)
     if stdout:
         LOG.log(stdout)
     return stdout,stderr 
Esempio n. 2
0
 def package(self,cwd,env,host=None,user=None,password=None):
     cmd=['file_name="'+ self.target % env + '"']
     self.trigger('result-package-before')
     if not host or host == "127.0.0.1":
         stdout,stderr=run.execute_helper(self.script,cmd,cwd=cwd)
     else:
         client = ssh.SSHUtil(host,user,password)
         stdout,stderr=client.execute_lines([" ".join([self.script] + cmd)],cwd=cwd)
     self.trigger('result-package-after')
     if stderr:
         LOG.error(stderr)
     if stdout:
         LOG.log(stdout)
     return stdout,stderr