It's possible for the inventory to be queried more than once. However,withcurrentimplementationthiswouldresultinstartingmultipleVMs,possiblywithclashingnamesandmultipleuselesslogfilesandexcessresourceconsumption.The--hostCLIisexpectedtohaveidenticaloutputwitheverycallwithidenticalinput.ThecurrentimplementationresultsinbothvaryingoutputandlaunchingmultipleVMs,possiblywithclashingnamesandcausingexcessiveandunintendedresourceconsumption.TheinventoryAPIexpectsdns-complianthostnames,howevertheimage-pathisassumedasCWDbutnevervalidated.Thereforit's easily possible for pathname components to end up aspartoftheVMshostname,possiblyleadingtooddbehavior.Fixthepathvshostnameissuebypassingthepaththrough``os.path.basename``forallapplicablecallsandreferences.Verifytherearenoconflicts/clashesoverhostnamespriortocreatingVMsorcachingdetails.Employlockingonpersistentcachetopreventmultipleparallelcallsfromcorruptingdata.Allcallswitheither--hostor--list,utilizethecacheandcheckforexistingVMsbeforecreatingnewones.Uponparent-processexit,theyareremovedfromcache.Addunitteststocovermostoftheabovefeatures/changes.Signed-off-by:ChrisEvich<cevich@redhat.com>
Fix standard-inventory-qcow2 standards compliance