fix __opts__ and provider being None issue

This commit is contained in:
Mark McGuire 2016-11-10 21:22:33 -06:00
parent b14faf1c68
commit a452cded20

View file

@ -577,8 +577,10 @@ def get_location(opts=None, provider=None):
DEFAULT_LOCATION
'''
if opts is None:
opts = __opts__
ret = opts.get('location', provider.get('location'))
opts = {}
ret = opts.get('location')
if ret is None and provider is not None:
ret = provider.get('location')
if ret is None:
ret = get_region_from_metadata()
if ret is None: