diff --git a/cloud/openstack/os_project.py b/cloud/openstack/os_project.py index eeaa101e660..4c686724c89 100644 --- a/cloud/openstack/os_project.py +++ b/cloud/openstack/os_project.py @@ -21,6 +21,8 @@ try: except ImportError: HAS_SHADE = False +from distutils.version import StrictVersion + DOCUMENTATION = ''' --- module: os_project @@ -46,7 +48,8 @@ options: default: None domain_id: description: - - Domain id to create the project in if the cloud supports domains + - Domain id to create the project in if the cloud supports domains. + The domain_id parameter requires shade >= 1.8.0 required: false default: None aliases: ['domain'] @@ -160,6 +163,9 @@ def main(): enabled = module.params['enabled'] state = module.params['state'] + if domain and StrictVersion(shade.__version__) < StrictVersion('1.8.0'): + module.fail_json(msg="The domain argument requires shade >=1.8.0") + try: if domain: opcloud = shade.operator_cloud(**module.params)