This commit adds a check to the dynamic inventory script when parsing extra values

This commit adds a check to the dynamic inventory script when parsing extra values.
Presently the sciprt expects a dict, however if the user passes a key with a string value 
the inventory parser breaks. This PR simply adds a check to the scrip to ensure that this
does not happen.

(cherry picked from commit 767aa6229dfb6e907bd2473e1f8efe235ebed44a)

Addresses issue: #458