Refactor the decorator which sets a default deploy_id

* The decorator is now more generic and is able to manage any default id.
* Refactored _deployment_default_id in the generic function _get_global
The function was simplified by avoiding the use of 'except KeyError' and
it makes it more readable.

Change-Id: I4b822f954059f604cf5248550df1e20ef94a8d64