mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
parted: Allow passing negative numbers to specify partition boundary relative to disk end (#129)
* Allow passing negative numbers to specify partition boundary relative to disk end
Fixes: https://github.com/ansible/ansible/issues/43369
* parted: unit test case, create partition with part_start: -1GiB
* fs_type parameter is not really optional for negative part_start parameter
* Revert "fs_type parameter is not really optional for negative part_start parameter"
This reverts commit 800b1cb00b
.
Instead: added notes and documentation about netagive part_start and fs_type.
* include fs_type in negative part_start example
This commit is contained in:
parent
4399759cf3
commit
ced14746a8
3 changed files with 33 additions and 5 deletions
|
@ -198,6 +198,17 @@ class TestParted(ModuleTestCase):
|
|||
with patch('ansible_collections.community.general.plugins.modules.system.parted.get_device_info', return_value=parted_dict1):
|
||||
self.execute_module(changed=True, script='unit KiB mkpart primary 0% 1GiB')
|
||||
|
||||
def test_create_new_partition_minus_1G(self):
|
||||
set_module_args({
|
||||
'device': '/dev/sdb',
|
||||
'number': 4,
|
||||
'state': 'present',
|
||||
'fs_type': 'ext2',
|
||||
'part_start': '-1GiB',
|
||||
})
|
||||
with patch('ansible_collections.community.general.plugins.modules.system.parted.get_device_info', return_value=parted_dict1):
|
||||
self.execute_module(changed=True, script='unit KiB mkpart primary ext2 -1GiB 100%')
|
||||
|
||||
def test_remove_partition_number_1(self):
|
||||
set_module_args({
|
||||
'device': '/dev/sdb',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue