mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-26 17:25:22 +03:00
create: Auto-generate fs path if not provided
Use default place to store file systems of bootstraped containers. If the current user has effective UID 0 use: /var/lib/libvirt/filesystems/<container-name> otherwise use: ~/.local/share/libvirt/filesystems/<container-name>
This commit is contained in:
parent
c5264a2390
commit
89e5783cad
@ -1653,6 +1653,17 @@ class vmmCreate(vmmGObjectUI):
|
||||
enable_src = self.widget("install-oscontainer-bootstrap").get_active()
|
||||
self.widget("install-oscontainer-source").set_sensitive(enable_src)
|
||||
|
||||
# Auto-generate a path if not specified
|
||||
if enable_src and not self.widget("install-oscontainer-fs").get_text():
|
||||
if os.geteuid() == 0:
|
||||
fs_dir = ['/var/lib/libvirt/filesystems/']
|
||||
else:
|
||||
fs_dir = [os.environ['HOME'],
|
||||
'.local/share/libvirt/filesystems/']
|
||||
|
||||
fs = fs_dir + [self._generate_default_name(None, None)]
|
||||
self.widget("install-oscontainer-fs").set_text(os.path.join(*fs))
|
||||
|
||||
|
||||
########################
|
||||
# Misc helper routines #
|
||||
|
Loading…
Reference in New Issue
Block a user