Fix for an exception when for whatever reason the inventory script fails
Fix for an exception when for whatever reason the inventory script fails

This avoids a traceback that gave no clue as to what was happening.

This is in line with the change from #1535

thaim/ansible,thaim/ansible