* preserve same order as inventory manager when using inventory_hostnames lookup add a test * move generic code