Refactor save inventory of vm_and_templates according to review
Refactor save inventory of vm_and_templates according to review

Refactor save inventory of vm_and_templates according to review,
using group_by and indexed by

Also deleting used vm from vms_by_uid_ems using
vms_by_uid_ems[h[:uid_ems]].delete(found) with explanation
from Fryguy:"
I don't think you can delete this line. Its purpose, I think
it to ensure that the same vm isn't referenced twice. That is,
if two vms have the same uid_ems, then on the first pass of
the loop it might grab the first one, and we want to ensure
that on the second pass of the loop it grabs the second one.
I think all that has to happen is to remove it from the
new indexed_vms"

d-m-u/manageiq,hstastna/manageiq,jvlcek/manageiq,NickLaMuro/manageiq,lpichler/manageiq,ManageIQ/manageiq,gerikis/manageiq,ilackarms/manageiq,lpichler/manageiq,d-m-u/manageiq,hstastna/manageiq,mzazrivec/manageiq,israel-hdez/manageiq,jntullo/manageiq,mresti/manageiq,mzazrivec/manageiq,borod108/manageiq,djberg96/manageiq,tzumainn/manageiq,skateman/manageiq,israel-hdez/manageiq,jameswnl/manageiq,mresti/manageiq,kbrock/manageiq,mzazrivec/manageiq,d-m-u/manageiq,matobet/manageiq,pkomanek/manageiq,matobet/manageiq,juliancheal/manageiq,branic/manageiq,yaacov/manageiq,jvlcek/manageiq,ilackarms/manageiq,romanblanco/manageiq,fbladilo/manageiq,durandom/manageiq,hstastna/manageiq,lpichler/manageiq,jameswnl/manageiq,jntullo/manageiq,gerikis/manageiq,israel-hdez/manageiq,fbladilo/manageiq,NickLaMuro/manageiq,djberg96/manageiq,NaNi-Z/manageiq,mkanoor/manageiq,andyvesel/manageiq,israel-hdez/manageiq,kbrock/manageiq,agrare/manageiq,mfeifer/manageiq,chessbyte/manageiq,skateman/manageiq,chessbyte/manageiq,tinaafitz/manageiq,NickLaMuro/manageiq,ailisp/manageiq,borod108/manageiq,jameswnl/manageiq,jntullo/manageiq,agrare/manageiq,ilackarms/manageiq,syncrou/manageiq,tinaafitz/manageiq,branic/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,gmcculloug/manageiq,romanblanco/manageiq,aufi/manageiq,juliancheal/manageiq,romanblanco/manageiq,romanblanco/manageiq,ailisp/manageiq,andyvesel/manageiq,gerikis/manageiq,hstastna/manageiq,mkanoor/manageiq,josejulio/manageiq,yaacov/manageiq,kbrock/manageiq,gerikis/manageiq,syncrou/manageiq,yaacov/manageiq,durandom/manageiq,jrafanie/manageiq,kbrock/manageiq,agrare/manageiq,durandom/manageiq,pkomanek/manageiq,djberg96/manageiq,lpichler/manageiq,mfeifer/manageiq,mfeifer/manageiq,mzazrivec/manageiq,jrafanie/manageiq,djberg96/manageiq,jntullo/manageiq,tinaafitz/manageiq,josejulio/manageiq,tzumainn/manageiq,fbladilo/manageiq,gmcculloug/manageiq,josejulio/manageiq,mkanoor/manageiq,ManageIQ/manageiq,skateman/manageiq,ilackarms/manageiq,aufi/manageiq,ailisp/manageiq,jameswnl/manageiq,chessbyte/manageiq,aufi/manageiq,gmcculloug/manageiq,jvlcek/manageiq,agrare/manageiq,andyvesel/manageiq,branic/manageiq,billfitzgerald0120/manageiq,billfitzgerald0120/manageiq,NaNi-Z/manageiq,jrafanie/manageiq,aufi/manageiq,josejulio/manageiq,NaNi-Z/manageiq,billfitzgerald0120/manageiq,ailisp/manageiq,borod108/manageiq,mfeifer/manageiq,mresti/manageiq,tzumainn/manageiq,matobet/manageiq,fbladilo/manageiq,durandom/manageiq,pkomanek/manageiq,mkanoor/manageiq,chessbyte/manageiq,yaacov/manageiq,skateman/manageiq,mresti/manageiq,NickLaMuro/manageiq,ManageIQ/manageiq,billfitzgerald0120/manageiq,jrafanie/manageiq,syncrou/manageiq,gmcculloug/manageiq,juliancheal/manageiq,tzumainn/manageiq,d-m-u/manageiq,borod108/manageiq,andyvesel/manageiq,pkomanek/manageiq,juliancheal/manageiq,jvlcek/manageiq,NaNi-Z/manageiq,branic/manageiq,syncrou/manageiq,matobet/manageiq