The liblxc API currently doesn't work as non-root, so check that the euid
is 0 when getting a Container instance in the python API.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
warnings.warn("The python-lxc API isn't yet stable "
"and may change at any point in the future.", Warning, 2)
+
class ContainerNetwork():
props = {}
Creates a new Container instance.
"""
+ if os.geteuid() != 0:
+ raise Exception("Running as non-root.")
+
_lxc.Container.__init__(self, name)
self.network = ContainerNetworkList(self)