Merge pull request #25278 from rallytime/fix-25228

Don't require size for all cloud drivers when checking profile configs
This commit is contained in:
Joseph Hall 2015-07-08 20:52:23 -06:00
commit e078a6d924

View File

@ -2390,8 +2390,16 @@ def is_profile_configured(opts, provider, profile_name):
.. versionadded:: Beryllium
'''
required_keys = ['image', 'provider', 'size']
# Standard dict keys required by all drivers.
required_keys = ['image', 'provider']
alias, driver = provider.split(':')
# Most drivers need a size, but some do not.
non_size_drivers = ['parallels', 'softlayer', 'softlayer_hw']
if driver not in non_size_drivers:
required_keys.append('size')
provider_key = opts['providers'][alias][driver]
profile_key = opts['providers'][alias][driver]['profiles'][profile_name]