diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-09-16 08:44:25 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-09-16 08:44:25 -0700 |
| commit | e09b3d70e5a4aaa00f5ba62d1eab5d6d57a800e1 (patch) | |
| tree | ecdb656691940b27ba2e131f050568cc43becaea | |
| parent | f31748460180aeff00f08b70b6134b63faf293fa (diff) | |
| download | nova-e09b3d70e5a4aaa00f5ba62d1eab5d6d57a800e1.tar.gz nova-e09b3d70e5a4aaa00f5ba62d1eab5d6d57a800e1.tar.xz nova-e09b3d70e5a4aaa00f5ba62d1eab5d6d57a800e1.zip | |
fix permissions
| -rw-r--r-- | nova/virt/libvirt/connection.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index 31b08be68..4e91415a7 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -814,8 +814,10 @@ class LibvirtConnection(driver.ComputeDriver): utils.execute('mkdir', '-p', container_dir) # NOTE(vish): No need add the suffix to console.log - os.close(os.open(basepath('console.log', ''), - os.O_CREAT | os.O_WRONLY, 0660)) + console_log = basepath('console.log', '') + if os.path.exists(console_log): + utils.execute('chown', os.getuid(), console_log, run_as_root=True) + os.close(os.open(console_log, os.O_CREAT | os.O_WRONLY, 0660)) if not disk_images: disk_images = {'image_id': inst['image_ref'], |
