Bug 1195204

Summary: `virt-builder` should create $HOME/.cache directory if it already doesn't exist
Product: [Community] Virtualization Tools Reporter: Kashyap Chamarthy <kchamart>
Component: libguestfsAssignee: Pino Toscano <ptoscano>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-24 09:24:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kashyap Chamarthy 2015-02-23 11:14:20 UTC
Description of problem:

If $HOME/.cache directory does not exist, `virt-builder` will disable caching -- it fails to create $HOME/.cache/virt-builder directory as it assumes the parent directory $HOME/.cache/ already exists.

It is desirable to have `virt-builder` to create the $HOME/.cache (if it already doesn't exist) so that the downloaded operating system templates can be cached. 

So, it should do something like:

  mkdir -p $HOME/.cache/virt-builder
 

Version-Release number of selected component (if applicable):

  libguestfs-1.29.26-1.fc23

How reproducible: All the time

Comment 1 Richard W.M. Jones 2015-02-23 11:21:50 UTC
I have observed this too, especially for /root for some reason.

Comment 2 Kashyap Chamarthy 2015-02-24 09:23:14 UTC
Pino posted a patch upstream, that's also ACKed

  https://www.redhat.com/archives/libguestfs/2015-February/msg00188.html

Comment 3 Pino Toscano 2015-02-24 09:24:52 UTC
Fixed with
https://github.com/libguestfs/libguestfs/commit/652af7a33ac769b063cadddc41786dc69bbe2792
which is libguestfs >= 1.29.27.