(self, cmd)
| 44 | subprocess.check_call(cmd, shell=True) |
| 45 | |
| 46 | def cmd(self, cmd): |
| 47 | assert isinstance(cmd, list), "code issue happened!!" |
| 48 | try: |
| 49 | for sub_cmd in cmd: |
| 50 | p_cmd = 'ssh -p {} {}@{} "{}" '.format( |
| 51 | self.port, self.login_name, self.ip, sub_cmd |
| 52 | ) |
| 53 | logging.debug("ssh run cmd: {}".format(p_cmd)) |
| 54 | subprocess.check_call(p_cmd, shell=True) |
| 55 | except: |
| 56 | raise |
| 57 | |
| 58 | |
| 59 | def main(): |