parted module not idempotent for esp flag and name (#40547)

* parted module not idempotent for esp flag and name

Fixes #40452

Currently the parted module doesn't take into account names with
spaces in them which leads to non-idempotent transactions on the
state of the system because the name comparison will never succeed.

Also, when the esp flag is set, parted infers the boot flag and the
parted module did not previously account for this. This lead to
non-idempotent transactions as well.

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix unit tests, expected command changed in the patch

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2018-05-23 10:06:26 -05:00 committed by Brian Coca
parent 67e0df81c1
commit bc7ff83cd9
2 changed files with 10 additions and 2 deletions

View file

@ -237,4 +237,4 @@ class TestParted(ModuleTestCase):
'_ansible_check_mode': True,
})
with patch('ansible.modules.system.parted.get_device_info', return_value=parted_dict2):
self.execute_module(changed=True, script='unit KiB mklabel gpt mkpart primary 0% 100% unit KiB name 1 lvmpartition set 1 lvm on')
self.execute_module(changed=True, script='unit KiB mklabel gpt mkpart primary 0% 100% unit KiB name 1 \'"lvmpartition"\' set 1 lvm on')