Re: [virt-bootstrap] [PATCH v6 25/26] Use cache directory to store downloaded tar files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-08-17 at 10:40 +0100, Radostin Stoyanov wrote:
> ---
>  src/virtBootstrap/utils.py | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
> index f670919..d699778 100644
> --- a/src/virtBootstrap/utils.py
> +++ b/src/virtBootstrap/utils.py
> @@ -47,11 +47,14 @@ DEF_BASE_IMAGE_SIZE = 5 * 1024 * 1024 * 1024
>  
>  if os.geteuid() == 0:
>      LIBVIRT_CONN = "lxc:///"
> -    DEFAULT_IMG_DIR = "/var/lib/virt-bootstrap/docker_images"
> +    DEFAULT_IMG_DIR = "/var/cache/virt-bootstrap/docker_images"
>  else:
>      LIBVIRT_CONN = "qemu:///session"
> -    DEFAULT_IMG_DIR = os.environ['HOME']
> -    DEFAULT_IMG_DIR += "/.local/share/virt-bootstrap/docker_images"
> +    if 'XDG_CACHE_HOME' in os.environ:
> +        DEFAULT_IMG_DIR = os.environ['XDG_CACHE_HOME']
> +    else:
> +        DEFAULT_IMG_DIR = os.environ['HOME'] + '/.cache'
> +    DEFAULT_IMG_DIR += '/virt-bootstrap/docker_images'
>  
>  # Set temporary directory
>  tmp_dir = os.environ.get('VIRTBOOTSTRAP_TMPDIR', '/tmp')
ACK

--
Cedric

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux