Bug 723922 - [lvm] same exit status for different errors on pvcreate command
Summary: [lvm] same exit status for different errors on pvcreate command
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-21 14:49 UTC by Haim
Modified: 2014-01-13 00:49 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 15:14:05 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Haim 2011-07-21 14:49:58 UTC
Description of problem:

several permutations of pvcreate command: 

create pv which is already created:

[root@nott-vds5 ~]# pvcreate /dev/mapper/1IET_00010001 --metadatasi 1m -M 2
  Can't initialize physical volume "/dev/mapper/1IET_00010001" of volume group "VGscale" without -ff

[root@nott-vds5 ~]# echo $?
5

create pv with wrong device:

[root@nott-vds5 ~]# pvcreate /dev/mapper/1IET_00010
  Device /dev/mapper/1IET_00010 not found (or ignored by filtering).


[root@nott-vds5 ~]# echo $?
5

in case i want to build a script or a login parsing error code i might be in trouble.

Comment 2 Alasdair Kergon 2011-07-21 15:14:05 UTC
We decided in the beginning not to attempt to create and maintain an exhaustive list of failure codes.  We have two basic codes - one for a problem parsing or understanding the command line, the other for any other type of real failure.

If your script needs to distinguish different failure cases, it needs to check each of them one-by-one itself.  'pvs' helps if you need to check lvm things individually.

This isn't something we've any plans to change, I'm afraid.


Note You need to log in before you can comment on or make changes to this bug.