def getSubContainers(container, lxcpath):
- attach = ['lxc-attach', '-R', '-s', 'NETWORK|PID', '-n', container,
+ attach = ['lxc-attach', '-P', lxcpath, '-R', '-s', 'NETWORK|PID',
+ '-n', container,
'--', sys.argv[0], "--nesting"]
with open(os.devnull, "w") as fd:
newenv = dict(os.environ)
- newenv['NESTED'] = "/proc/1/root/%s" % lxcpath
+ newenv['NESTED'] = "/proc/1/root/%s" % lxc.default_config_path
sp = subprocess.Popen(attach, stderr=fd, stdout=subprocess.PIPE,
env=newenv, universal_newlines=True)
sp.wait()
if count != 0:
time.sleep(1)
- base_cmd = ["lxc-attach", "-s", "NETWORK", "-n", self.name, "--",
+ base_cmd = ["lxc-attach", "-s", "NETWORK",
+ "-P", self.get_config_path(), "-n", self.name, "--",
"ip"]
# Get IPv6