LXD changes

Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
Chuck Short 2015-02-17 12:55:36 -05:00
parent b507312441
commit f2d93330f6
2 changed files with 4 additions and 20 deletions

View File

@ -21,18 +21,7 @@ function configure_lxd {
install_package python-software-properties
apt_get update
install_package golang
install_package lxc lxc-dev mercurial pkg-config build-essential
if [[ ! -d $HOME/go ]]; then
mkdir -p $HOME/go
export GOPATH=$HOME/go
fi
go get github.com/lxc/lxd
cd $GOPATH/src/github.com/lxc/lxd
go get -v -d ./...
make
apt-add-repository -y ppa:ubuntu-lxc/lxd-daily
if [[ ! -d /var/lib/lxd ]]; then
sudo mkdir -p /var/lib/lxd/

View File

@ -52,14 +52,9 @@ class Container(object):
self.vif_driver = vif.LXDGenericDriver()
def init_container(self):
lxc_cgroup = uuid.uuid4()
utils.execute('cgm', 'create', 'all', lxc_cgroup,
run_as_root=True)
utils.execute('cgm', 'chown', 'all', lxc_cgroup,
pwd.getpwuid(os.getuid()).pw_uid,
pwd.getpwuid(os.getuid()).pw_gid,
run_as_root=True)
utils.execute('cgm', 'movepid', 'all', lxc_cgroup, os.getpid())
if not os.path.exists(CONF.lxd.lxd_socket):
msg = _('LXD is not running.')
raise exception(msg)
def get_console_log(self, instance):
console_log = os.path.join(CONF.lxd.lxd_root_dir,