[Libguestfs] [PATCH 2/2] v2v: -o rhv-upload: use same tmpdir for Python scripts

Pino Toscano ptoscano at redhat.com
Fri Sep 20 09:15:31 UTC 2019


On Thursday, 19 September 2019 20:50:59 CEST Richard W.M. Jones wrote:
> On Thu, Sep 19, 2019 at 02:30:05PM +0200, Pino Toscano wrote:
> > Make use of the temporary directory of the rhv-upload mode also for the
> > Python scripts that the mode creates, instead of creating new
> > directories.
> > ---
> >  v2v/output_rhv_upload.ml | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
> > index eec9c5c79..78e9145c6 100644
> > --- a/v2v/output_rhv_upload.ml
> > +++ b/v2v/output_rhv_upload.ml
> > @@ -106,19 +106,19 @@ class output_rhv_upload output_alloc output_conn
> >  
> >    (* Create Python scripts for precheck, vmcheck, plugin and create VM. *)
> >    let precheck_script =
> > -    Python_script.create ~name:"rhv-upload-precheck.py"
> > +    Python_script.create ~name:"rhv-upload-precheck.py" ~tmpdir
> >                           Output_rhv_upload_precheck_source.code in
> >    let vmcheck_script =
> > -    Python_script.create ~name:"rhv-upload-vmcheck.py"
> > +    Python_script.create ~name:"rhv-upload-vmcheck.py" ~tmpdir
> >                           Output_rhv_upload_vmcheck_source.code in
> >    let plugin_script =
> > -    Python_script.create ~name:"rhv-upload-plugin.py"
> > +    Python_script.create ~name:"rhv-upload-plugin.py" ~tmpdir
> >                           Output_rhv_upload_plugin_source.code in
> >    let createvm_script =
> > -    Python_script.create ~name:"rhv-upload-createvm.py"
> > +    Python_script.create ~name:"rhv-upload-createvm.py" ~tmpdir
> >                           Output_rhv_upload_createvm_source.code in
> >    let deletedisks_script =
> > -    Python_script.create ~name:"rhv-upload-deletedisks.py"
> > +    Python_script.create ~name:"rhv-upload-deletedisks.py" ~tmpdir
> >                           Output_rhv_upload_deletedisks_source.code in
> 
> Nice change, ACK.
> 
> It could even be shorter with:
> 
>   let create = Python_script.create ~tmpdir in
>   let precheck_script = create "rhv-upload-precheck.py"
>                                Output_rhv_upload_precheck_source.code in

Good idea, thanks (named it 'py_create' instead so it is more clear it
refers to the Python stuff).

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190920/6a064ac1/attachment.sig>


More information about the Libguestfs mailing list