Bug 1370002

Summary: vgchange --addtag completes without error but queried tag value does not match
Product: [Fedora] Fedora Reporter: Tony Asleson <tasleson>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: agk, anprice, bmarzins, bmr, heinzm, jonathan, lvm-team, msnitzer, prajnoha, prockai, teigland, zkabelac
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-26 14:38:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tony Asleson 2016-08-25 03:14:06 UTC
Description of problem:

# vgchange test --addtag "--h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy-=j649x:+dUcYWPEo6.IWT0c"
  Volume group "test" successfully changed
[root@localhost dbus]# vgs -o+tags
  VG   #PV #LV #SN Attr   VSize  VFree  VG Tags                                                 
  test   1   0   0 wz--n- 16.00g 16.00g --h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy=j649x:+dUcYWPEo6.IWT0c


The tags do not match
--h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy-=j649x:+dUcYWPEo6.IWT0c
--h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy=j649x:+dUcYWPEo6.IWT0c

Version-Release number of selected component (if applicable):

F24 & Rawhide both exhibit same behavior

How reproducible:
100%

Steps to Reproduce:
See problem description

Actual results:
Tag added != tag retrieved

Expected results:
Tag added == tag retrieved

Additional info:

Comment 1 David Teigland 2016-08-26 14:19:53 UTC
any argv lvm sees that starts with -- is de-hypenated before matching with known options, so the '-' in the middle is removed.

Comment 2 Zdenek Kabelac 2016-08-26 14:27:54 UTC
so we surely need to 'dehyphen' only options - not their args.

Comment 3 David Teigland 2016-08-26 14:38:49 UTC
when using unusual tag names like this, either one of the following forms would work:

--addtag=--h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy-=j649x:+dUcYWPEo6.IWT0c
--addtag @--h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy-=j649x:+dUcYWPEo6.IWT0c

Comment 4 Alasdair Kergon 2016-08-26 20:35:19 UTC
(In reply to Zdenek Kabelac from comment #2)
> so we surely need to 'dehyphen' only options - not their args.

That's hard.  There are some easy improvements we could make though, like not touching items that don't have the right characteristics to be arguments.

Comment 5 Zdenek Kabelac 2016-08-26 20:41:45 UTC
We should just keep args in both forms hyphened and de-hyphened - and use the right one for option and for its arg