device now defaults to object_id

This commit is contained in:
Daniel Heule 2016-08-02 11:06:17 +02:00
parent 13b2443d6b
commit 8747474fd5
5 changed files with 18 additions and 8 deletions

View File

@ -20,7 +20,11 @@
os=$("$__explorer/os") os=$("$__explorer/os")
blkdev="$(cat "$__object/parameter/device")" if [ -f "$__object/parameter/device" ]; then
blkdev="$(cat "$__object/parameter/device")"
else
blkdev="$__object_id"
fi
case "$os" in case "$os" in
centos|fedora|redhat|suse|gentoo) centos|fedora|redhat|suse|gentoo)

View File

@ -20,7 +20,12 @@
fstype="$(cat "$__object/parameter/fstype")" fstype="$(cat "$__object/parameter/fstype")"
mydev="$(cat "$__object/parameter/device")"
if [ -f "$__object/parameter/device" ]; then
mydev="$(cat "$__object/parameter/device")"
else
mydev="$__object_id"
fi
label="$(cat "$__object/parameter/label")" label="$(cat "$__object/parameter/label")"
mkfsoptions="$(cat "$__object/parameter/mkfsoptions")" mkfsoptions="$(cat "$__object/parameter/mkfsoptions")"

View File

@ -22,8 +22,12 @@ REQUIRED PARAMETERS
fstype fstype
Filesystem type, for example 'ext3', 'btrfs' or 'xfs' Filesystem type, for example 'ext3', 'btrfs' or 'xfs'
OPTIONAL PARAMETERS
-------------------
device device
Blockdevice for filesystem, Blockdevice for filesystem, Defaults to object_id.
On linux, it can be any by lsblk accepted device notation On linux, it can be any by lsblk accepted device notation
for example for example
@ -31,9 +35,6 @@ device
or /dev/disk/by-xxxx/xxx or /dev/disk/by-xxxx/xxx
or /dev/mapper/xxxx or /dev/mapper/xxxx
OPTIONAL PARAMETERS
-------------------
label label
Label which sould apply on the filesystem Label which sould apply on the filesystem
@ -61,7 +62,7 @@ EXAMPLES
.. code-block:: sh .. code-block:: sh
# Ensures that device /dev/sdb is formated with xfs # Ensures that device /dev/sdb is formated with xfs
__filesystem dev_sdb --fstype xfs --device /dev/sdb --label Testdisk1 __filesystem /dev/sdb --fstype xfs --label Testdisk1
# The same thing with btrfs and disk spezified by pci path to disk 1:0 on vmware # The same thing with btrfs and disk spezified by pci path to disk 1:0 on vmware
__filesystem dev_sdb --fstype btrfs --device /dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:0:0 --label Testdisk2 __filesystem dev_sdb --fstype btrfs --device /dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:0:0 --label Testdisk2
# Make sure that a multipath san device has a filesystem ... # Make sure that a multipath san device has a filesystem ...

View File

@ -1,2 +1,3 @@
device
label label
mkfsoptions mkfsoptions

View File

@ -1,2 +1 @@
fstype fstype
device