mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Support updating extra_specs in project module
It supports for adding extra_specs in updating project. Change-Id: I98a73ed9367d52df82213b3b7c484ceac10acf3d Signed-off-by: Naoki Hanakawa <naoki.hanakawa@lycorp.co.jp>
This commit is contained in:
@@ -174,6 +174,38 @@
|
||||
that:
|
||||
- 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
|
||||
openstack.cloud.project:
|
||||
cloud: "{{ cloud }}"
|
||||
|
||||
@@ -181,7 +181,7 @@ class IdentityProjectModule(OpenStackModule):
|
||||
raise ValueError('Duplicate key(s) in extra_specs: {0}'
|
||||
.format(', '.join(list(duplicate_keys))))
|
||||
for k, v in extra_specs.items():
|
||||
if v != project[k]:
|
||||
if k not in project or v != project[k]:
|
||||
attributes[k] = v
|
||||
|
||||
if attributes:
|
||||
|
||||
Reference in New Issue
Block a user