mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Merge "Support updating extra_specs in project module"
This commit is contained in:
@@ -174,6 +174,38 @@
|
|||||||
that:
|
that:
|
||||||
- project.project.is_enabled == True
|
- project.project.is_enabled == True
|
||||||
|
|
||||||
|
- name: Update project to add new extra_specs
|
||||||
|
openstack.cloud.project:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
state: present
|
||||||
|
name: ansible_project
|
||||||
|
extra_specs:
|
||||||
|
is_enabled: True
|
||||||
|
another_tag: True
|
||||||
|
register: project
|
||||||
|
|
||||||
|
- name: Assert return values of project module
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- project.project.is_enabled == True
|
||||||
|
- project.project.another_tag == True
|
||||||
|
|
||||||
|
- name: Update project to change existing extra_specs
|
||||||
|
openstack.cloud.project:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
state: present
|
||||||
|
name: ansible_project
|
||||||
|
extra_specs:
|
||||||
|
is_enabled: True
|
||||||
|
another_tag: False
|
||||||
|
register: project
|
||||||
|
|
||||||
|
- name: Assert return values of project module
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- project.project.is_enabled == True
|
||||||
|
- project.project.another_tag == False
|
||||||
|
|
||||||
- name: Delete project
|
- name: Delete project
|
||||||
openstack.cloud.project:
|
openstack.cloud.project:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ class IdentityProjectModule(OpenStackModule):
|
|||||||
raise ValueError('Duplicate key(s) in extra_specs: {0}'
|
raise ValueError('Duplicate key(s) in extra_specs: {0}'
|
||||||
.format(', '.join(list(duplicate_keys))))
|
.format(', '.join(list(duplicate_keys))))
|
||||||
for k, v in extra_specs.items():
|
for k, v in extra_specs.items():
|
||||||
if v != project[k]:
|
if k not in project or v != project[k]:
|
||||||
attributes[k] = v
|
attributes[k] = v
|
||||||
|
|
||||||
if attributes:
|
if attributes:
|
||||||
|
|||||||
Reference in New Issue
Block a user