Improvement: return instance of class from factory, not class itself

This commit is contained in:
James Page 2015-12-18 11:41:29 +00:00
parent d3b2c90331
commit ac3d716713

View File

@ -100,8 +100,11 @@ class OpenStackCharmFactory(object):
@classmethod
def charm(cls, release=None):
"""Get the right charm for the configured OpenStack series"""
"""
Get an instance of the right charm for the
configured OpenStack series
"""
if release and release in cls.releases:
return cls.releases[release]
return cls.releases[release]()
else:
return cls.releases[cls.first_release]
return cls.releases[cls.first_release]()