[ansible] Fix nits in ironic_parted module

this is a followup to I4d6d7619c6f3ba25c29263ffe5d778698e598429
([ansible] Improve partition images support)

fixes some typos and removes commented/unused code.

Change-Id: Iafda13a657956bc04b591c0911cf3338705f33c4
This commit is contained in:
Pavlo Shchelokovskyy 2017-06-23 07:11:41 +00:00
parent b4fc5fae01
commit f6736f563e
1 changed files with 2 additions and 11 deletions

View File

@ -55,7 +55,7 @@ options:
version_added: null
label:
description: |
type of a partition type to create;
type of a partition table to create;
to use an existing partition table, omit it or pass null YAML value
required: false
default: none
@ -74,7 +74,7 @@ options:
partitions:
description:|
list of partitions. each entry is a dictionary in the form
- size: <int>, required, must be positive non-zero
- size: <int>, required, must be positive
type: [primary, extended, logical], default is primary
format: a format to pass to parted;
does not actually creates filesystems, only sets
@ -150,14 +150,6 @@ def change_part_args(part_number, partition):
return parted_args
def parse_lsblk_output(output):
devices = set()
for line in output.splitlines():
device = line.strip().split('=')[1]
devices.add(device.strip('"'))
return devices
def parse_lsblk_json(output):
def get_names(devices):
@ -294,7 +286,6 @@ def main():
lsblk_bin = module.get_bin_path('lsblk', required=True)
udevadm_bin = module.get_bin_path('udevadm', required=True)
parted = [parted_bin, '-s', device]
# lsblk = [lsblk_bin, '-o', 'NAME', '-P', device]
lsblk = [lsblk_bin, '-J', device]
if label:
module.run_command(parted + ['mklabel', label], check_rc=True)