It was checking if start or end was False. None, 0, and '' evaluate to False so
0 was being evaluated as an invalid parameter for start and end. Changed it to
specifically check for None and ''. 0 is a valid value for start and end.
This commit is contained in:
twangboy 2015-10-21 12:43:33 -06:00
parent ab18dcf637
commit ae8fbb208f

View file

@ -470,7 +470,7 @@ def mkpart(device, part_type, fs_type=None, start=None, end=None):
'''
_validate_device(device)
if not start or not end:
if start in [None, ''] or end in [None, '']:
raise CommandExecutionError(
'partition.mkpart requires a start and an end'
)