import subprocess class LXCManager: def execute(self, target, command): container = target.name return subprocess.call([ "lxc-attach", "-n", container, "--", "bash", "-c", command ])