Module Import alias Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Expr Str If NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Str If NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameStore NameStore NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Call NameLoad AttributeLoad NameLoad attr Str keyword Call NameLoad AttributeLoad NameLoad attr Str keyword Call NameLoad AttributeLoad NameLoad attr Str For TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword IfExp NameLoad Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return Call NameLoad TupleLoad Str Str NameLoad Str AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return Call NameLoad TupleLoad Str Str NameLoad keyword AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A os N/A pjoin N/A N/A os path join twisted.python log rce.util.process execute N/A _CONFIG_CGROUP 
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
 N/A _CONFIG_CAP 
# restrict capabilities
#   can't use: lxc.cap.drop = sys_admin
#   see: man capabilities for more information
#lxc.cap.drop = audit_control
#lxc.cap.drop = audit_write
#lxc.cap.drop = mac_admin
#lxc.cap.drop = mac_override
#lxc.cap.drop = mknod
#lxc.cap.drop = setfcap
#lxc.cap.drop = setpcap
#lxc.cap.drop = sys_boot
#lxc.cap.drop = sys_chroot
#lxc.cap.drop = sys_module
#lxc.cap.drop = sys_rawio
#lxc.cap.drop = sys_time
 N/A _FSTAB_BASE 
proc    {proc}    proc    nodev,noexec,nosuid    0 0
devpts    {devpts}    devpts    defaults    0 0
sysfs    {sysfs}    sysfs    defaults    0 0
 N/A _FSTAB_BIND 
{srcDir}    {dstDir}    none    bind{ro}    0 0
 Container N/A object N/A N/A  Class representing a single container.
     __init__ N/A N/A self reactor rootfs conf hostname N/A N/A N/A  Initialize the Container.

            @param reactor:     Reference to the twisted::reactor
            @type  reactor:     twisted::reactor

            @param rootfs:      Filesystem path of the root directory of the
                                container filesystem.
            @type  rootfs:      str

            @param conf:        Filesystem path of folder where configuration
                                files for the container should be stored.
            @type  conf:        str

            @param hostname:    Host name of the container.
            @type  hostname:    str
         N/A N/A self _reactor reactor N/A N/A self _rootfs rootfs N/A N/A self _conf N/A pjoin conf config N/A N/A self _fstab N/A pjoin conf fstab N/A N/A self _hostname hostname N/A N/A N/A N/A N/A os path isabs conf N/A N/A N/A ValueError Container configuration directory is not an absolute path. N/A N/A N/A N/A N/A os path isdir conf N/A N/A N/A ValueError N/A N/A Container Configuration directory does not exist: {0} format conf N/A N/A N/A N/A os path exists N/A self _conf N/A N/A N/A ValueError N/A N/A There is already a config file in the container configuration directory '{0}'. format conf N/A N/A N/A N/A os path exists N/A self _fstab N/A N/A N/A ValueError N/A N/A There is already a fstab file in the container configuration directory '{0}'. format conf N/A N/A self _ifs N/A N/A N/A self _fstabExt N/A N/A addNetworkInterface N/A N/A self name link ip up down N/A None None None None N/A N/A  Add a network interface to the configuration file.

            @param name:    Name of the network interface inside the container.
            @type  name:    str

            @param link:    Name of the network interface in the host system
                            which will be connected to the container network
                            interface.
            @type  link:    str

            @param ip:      IP address which will be assigned to the container
                            network interface. Use '0.0.0.0' for DHCP.
            @type  ip:      str

            @param up:      Path to a script which should be executed in the
                            host system once the interface has to be set up.
            @type  up:      str

            @param down:    Path to a script which should be executed in the
                            host system once the interface has to teared down.
            @type  down:    str
         N/A up N/A N/A N/A N/A N/A N/A os path isabs up N/A N/A N/A ValueError Path to up script has to be absolute. N/A N/A N/A N/A N/A os path isfile up N/A N/A N/A ValueError Path to up script is not a file. N/A N/A N/A N/A os access up N/A os X_OK N/A N/A N/A ValueError Up script is not executable. N/A down N/A N/A N/A N/A N/A N/A os path isabs down N/A N/A N/A ValueError Path to down script has to be absolute. N/A N/A N/A N/A N/A os path isfile down N/A N/A N/A ValueError Path to down script is not a file. N/A N/A N/A N/A os access down N/A os X_OK N/A N/A N/A ValueError Down script is not executable. N/A N/A N/A N/A self _ifs append N/A name link ip up down N/A extendFstab N/A N/A self src fs ro N/A N/A N/A  Add a line to the fstab file using bind.

            @param src:     Source path in host filesystem.
            @type  src:     str

            @param fs:      Path in container filesystem to which the source
                            should be bound.
            @type  fs:      str

            @param ro:      Flag to indicate whether bind should be read-only
                            or not.
            @type  ro:      bool
         N/A dst N/A pjoin N/A self _rootfs fs N/A N/A N/A N/A N/A os path isabs src N/A N/A N/A ValueError Source path has to be absolute. N/A N/A N/A N/A N/A os path exists src N/A N/A N/A ValueError Source path does not exist. N/A N/A N/A N/A N/A os path exists dst N/A N/A N/A ValueError Destination path does not exist. N/A N/A N/A N/A self _fstabExt append N/A src dst ro N/A _setupFiles N/A N/A self N/A N/A N/A  Setup the configuration and fstab file.
         N/A N/A open N/A self _conf w f N/A N/A N/A N/A f write N/A N/A lxc.utsname = {0}
 format N/A self _hostname N/A N/A N/A f write N/A N/A N/A f write N/A N/A lxc.rootfs = {0}
 format N/A self _rootfs N/A N/A N/A f write N/A N/A lxc.mount = {0}
 format N/A self _fstab N/A N/A name link ip up down N/A self _ifs N/A N/A N/A N/A f write N/A N/A N/A f write lxc.network.type = veth
 N/A N/A N/A f write lxc.network.flags = up
 N/A N/A N/A f write N/A N/A lxc.network.name = {0}
 format name N/A link N/A N/A N/A N/A f write N/A N/A lxc.network.link = {0}
 format link N/A ip N/A N/A N/A N/A f write N/A N/A lxc.network.ipv4 = {0}/24
 format ip N/A up N/A N/A N/A N/A f write N/A N/A lxc.network.script.up = {0}
 format up N/A down N/A N/A N/A N/A f write N/A N/A lxc.network.script.down = {0}
 format down N/A N/A N/A f write _CONFIG_CGROUP N/A N/A open N/A self _fstab w f N/A N/A N/A N/A f write N/A N/A _FSTAB_BASE format proc N/A pjoin N/A self _rootfs proc devpts N/A pjoin N/A self _rootfs dev/pts sysfs N/A pjoin N/A self _rootfs sys N/A N/A src dst ro N/A self _fstabExt N/A N/A N/A N/A f write N/A N/A _FSTAB_BIND format srcDir src dstDir dst ro N/A ro ,ro N/A start N/A N/A self name N/A N/A N/A  Start the container.

            @param name:    Name of the container which should be started.
            @type  name:    str

            @return:        Deferred whose callback is triggered on success or
                            whose errback is triggered on failure with an
                            error message.
            @rtype:         twisted.internet.defer.Deferred
         N/A N/A N/A self _setupFiles N/A N/A N/A log msg N/A N/A Start container '{0}' format name N/A N/A execute N/A /usr/bin/lxc-start -n name -f N/A self _conf -d reactor N/A self _reactor N/A stop N/A N/A self name N/A N/A N/A  Stop the container.

            @param name:        Name of the container which should be stopped.
            @type  name:        str

            @param command:     Deferred whose callback is triggered on success
                                or whose errback is triggered on failure with
                                an error message.
            @type  command:     twisted.internet.defer.Deferred
         N/A N/A N/A log msg N/A N/A Stop container '{0}' format name N/A N/A execute N/A /usr/bin/lxc-stop -n name reactor N/A self _reactor N/A N/A