[lxc-devel] [nova-lxd/master] Change location of console.log
zulcss on Github
lxc-bot at linuxcontainers.org
Mon Apr 11 19:09:15 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 567 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160411/49794854/attachment.bin>
-------------- next part --------------
From 92370937064fb72eca2468cfca149311c306b053 Mon Sep 17 00:00:00 2001
From: Chuck Short <chuck.short at canonical.com>
Date: Mon, 11 Apr 2016 15:04:49 -0400
Subject: [PATCH] Change location of console.log
Currently the console for the instance is written to
'/var/lib/contianers/instance-xxx/console.log'. This prevents from
LVM based instances from being destroyed properly because the
file is still open.
Signed-off-by: Chuck Short <chuck.short at canonical.com>
---
nova_lxd/nova/virt/lxd/utils.py | 3 +--
nova_lxd/tests/test_driver_api.py | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/nova_lxd/nova/virt/lxd/utils.py b/nova_lxd/nova/virt/lxd/utils.py
index d9fc97b..7ad822f 100644
--- a/nova_lxd/nova/virt/lxd/utils.py
+++ b/nova_lxd/nova/virt/lxd/utils.py
@@ -55,8 +55,7 @@ def get_container_configdrive(self, instance):
'configdrive')
def get_console_path(self, instance):
- return os.path.join(CONF.lxd.root_dir,
- 'containers',
+ return os.path.join('/var/log/lxd/',
instance,
'console.log')
diff --git a/nova_lxd/tests/test_driver_api.py b/nova_lxd/tests/test_driver_api.py
index f769924..630f231 100644
--- a/nova_lxd/tests/test_driver_api.py
+++ b/nova_lxd/tests/test_driver_api.py
@@ -252,7 +252,7 @@ def test_get_console_output(self, me, mo):
self.connection.get_console_output({}, instance))
calls = [
mock.call('chown', '1234:1234',
- '/fake/lxd/root/containers/fake-uuid/console.log',
+ '/var/log/lxd/fake-uuid/console.log',
run_as_root=True),
mock.call('chmod', '755',
'/fake/lxd/root/containers/fake-uuid',
More information about the lxc-devel
mailing list