示例#1
0
文件: command.py 项目: yaise/snix
 def execute(self):
     command = self._context['command']
     _exec_dir = self._context['command_exec_dir']
     if not os.path.isdir(_exec_dir):
         abort("{0} is not a valid path".format(_exec_dir))
     with execute_in_dir_and_revert(_exec_dir):
         execute(command, self._use_shell)
示例#2
0
 def execute(self):
     command = self._context['command']
     _exec_dir = self._context['command_exec_dir']
     if not os.path.isdir(_exec_dir):
         abort("{0} is not a valid path".format(_exec_dir))
     with execute_in_dir_and_revert(_exec_dir):
         execute(command, self._use_shell)
示例#3
0
文件: item.py 项目: nishantkakar/snix
 def install(self):
     msg = "Installing {0}...".format(self._context['name'])
     cmd, use_shell = CommandBuilder.build_install_cmd(self._context)
     logger.info(msg + cmd)
     ret = snixCore.execute(shlex.split(cmd), use_shell)
     #logger.info(msg+'StatusCode:'+str(ret))
     logger.info(msg + 'Done!. StatusCode:' + str(ret))
示例#4
0
文件: item.py 项目: yaise/snix
 def install(self):
     msg = "Installing {0}...".format(self._context['name'])
     cmd, use_shell = CommandBuilder.build_install_cmd(self._context)
     logger.info(msg+cmd)
     ret = snixCore.execute(shlex.split(cmd), use_shell)
     #logger.info(msg+'StatusCode:'+str(ret))
     logger.info(msg+'Done!. StatusCode:'+str(ret))
示例#5
0
文件: repo.py 项目: yaise/snix
 def clone(self):
     with execute_in_dir_and_revert(self._context['snix_root']):
         msg = "Cloning {0}...".format(self._context['repo_location'])
         cmd, use_shell = self._build_cmd()
         logger.info(msg + cmd)
         ret = execute(shlex.split(cmd), use_shell)
         logger.info(msg + 'StatusCode:' + str(ret))
         logger.info(msg + 'Done!')
示例#6
0
文件: repo.py 项目: nishantkakar/snix
 def clone(self):
     with execute_in_dir_and_revert(self._context['snix_root']):
         msg = "Cloning {0}...".format(self._context['repo_location'])
         cmd, use_shell = self._build_cmd()
         logger.info(msg + cmd)
         ret = execute(shlex.split(cmd), use_shell)
         logger.info(msg + 'StatusCode:' + str(ret))
         logger.info(msg + 'Done!')
示例#7
0
文件: script.py 项目: yaise/snix
 def execute(self):
     script_path = os.path.join(self._context["snix_root"], self._context["script_location"])
     if not os.access(script_path, os.X_OK):
         abort(script_path + "is not executable!")
     with execute_in_dir_and_revert(os.path.split(script_path)[0]):
         msg = "Executing {0}...".format(script_path)
         logger.info(msg + script_path)
         ret = execute(shlex.split(script_path), True)
         logger.info(msg + "StatusCode:" + str(ret))
         logger.info(msg + "Done!")