1 # SPDX-License-Identifier: GPL-2.0 2 3 import os 4 import subprocess 5 6 from lib.py import cmd 7 8 9 class Remote: 10 def __init__(self, name, dir_path): 11 self.name = name 12 self.dir_path = dir_path 13 14 def cmd(self, comm): 15 return subprocess.Popen(["ip", "netns", "exec", self.name, "bash", "-c", comm], 16 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 17 18 def deploy(self, what): 19 if os.path.isabs(what): 20 return what 21 return os.path.abspath(self.dir_path + "/" + what)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.