Bug 790295

Summary: RFE: Prompt for the missing options if not provided in command line during record add.
Product: Red Hat Enterprise Linux 6 Reporter: Gowrishankar Rajaiyan <grajaiya>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.3CC: dpal, grajaiya, jgalipea, mkosek, syeghiay
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.2.0-3.el6 Doc Type: Enhancement
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:18:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Gowrishankar Rajaiyan 2012-02-14 06:45:58 UTC
Description of problem:

This was raised by atolani as part of IPA DNS Test day.

When options are provided to dnsrecord-add and if any of the required option is missing, then the expected behaviour is to prompt for it interactively instead of displaying an error message. Similar to how we prompt for the zone name and record name if not provided in the command line.

for example: 
[root@zetaprime ~]# ipa dnsrecord-add --sshfp-algorithm=1 --sshfp-fp-type=1
Zone name: lab.eng.pnq.redhat.com
Record name: test44
ipa: ERROR: invalid 'sshfprecord': 'sshfp_fingerprint' is a required part of DNS record
[root@zetaprime ~]# 

Here the user expected a interactive prompt asking for "sshfp_fingerprint"

Version-Release number of selected component (if applicable):
ipa-server-2.2.0-101.20120127T0607zgit6863b8f.el6.x86_64

How reproducible:


Steps to Reproduce:
1. See description
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Martin Kosek 2012-02-14 14:46:52 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2386

Comment 3 Rob Crittenden 2012-03-02 20:21:55 UTC
fixed upstream:

master: 1d09cdf6342cfd715c366e881ced1d1f22d1503a

ipa-2-2: 104e9762375ac1d27fa0a853563b4de176d2fa8e

LOC is another record type that is interesting to test.

Also handles ^C and ^D.

Comment 5 Gowrishankar Rajaiyan 2012-04-16 08:14:32 UTC
[root@primenova ~]# ipa dnsrecord-add testrelm.com --sshfp-algorithm=2
Record name: sshfp
SSHFP Fingerprint Type: 2
SSHFP Fingerprint: 8F3AFB98121C1DFF087E004A862D30B8935946D8,
  Record name: sshfp
  SSHFP record: 2 2 8F3AFB98121C1DFF087E004A862D30B8935946D8,
[root@primenova ~]# 

This works as expected, however, while providing both --sshfp-algorithm and --sshfp-fp-type it asks for sshfp fingerprint multiple times.

[root@primenova ~]# ipa dnsrecord-add --sshfp-algorithm=1 --sshfp-fp-type=1
Zone name: testrelm.com
Record name: sshfp2
SSHFP Fingerprint: A69D7E3D53DB419FE43830956F08C0BC51431F89         <<<<<<
SSHFP Fingerprint: 8F3AFB98121C1DFF087E004A862D30B8935946D8         <<<<<<
  Record name: sshfp2
  SSHFP record: 1 1 8F3AFB98121C1DFF087E004A862D30B8935946D8


Tested in version: ipa-server-2.2.0-9.el6.x86_64

Comment 6 Martin Kosek 2012-04-16 08:57:29 UTC
Good catch, I will open a ticket to fix it and send a patch today.

Comment 7 Martin Kosek 2012-04-16 08:59:41 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2641

Comment 8 Rob Crittenden 2012-04-16 15:46:28 UTC
Fixed interactive prompting upstream.

master: 568de5027b9c7057e6f71cca4a45ced9ca7a7db6

ipa-2-2: 73b23bf21d0604cdc7c0b4a37011e01a17684faf

Comment 11 Martin Kosek 2012-04-24 11:38:12 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 12 Gowrishankar Rajaiyan 2012-05-14 19:52:20 UTC
[root@primenova ~]# ipa dnsrecord-add --sshfp-algorithm=1 --sshfp-fp-type=1
Zone name: lab.eng.pnq.redhat.com
Record name: test44
SSHFP Fingerprint: AF77D568A15C703DF5CEE89BFB76F0146DEA7586
  Record name: test44
  SSHFP record: 1 1 AF77D568A15C703DF5CEE89BFB76F0146DEA7586
[root@primenova ~]# 


[root@primenova ~]# ipa dnsrecord-add  --sshfp-fp-type=1
Zone name: lab.eng.pnq.redhat.com
Record name: test45
SSHFP Algorithm: 1
SSHFP Fingerprint: AF77D568A15C703DF5CEE89BFB76F0146DEA786
  Record name: test45
  SSHFP record: 1 1 AF77D568A15C703DF5CEE89BFB76F0146DEA786
[root@primenova ~]# 


[root@primenova ~]# ipa dnsrecord-add --sshfp-algorithm=1 --sshfp-fp-type=1
Zone name: lab.eng.pnq.redhat.com
Record name: test46
SSHFP Fingerprint: AF77D568A15C703DF5CEE89BFB76F0146DEA7869
  Record name: test46
  SSHFP record: 1 1 AF77D568A15C703DF5CEE89BFB76F0146DEA7869
[root@primenova ~]#

Comment 13 Gowrishankar Rajaiyan 2012-05-15 10:21:12 UTC
[root@primenova ~]# ipa dnsrecord-add lab.eng.pnq.redhat.com --loc-lat-deg=49 --loc-lat-min=11 --loc-lat-sec=42.4 --loc-lat-dir=N --loc-lon-deg=16 
Record name: test51
LOC Direction Longitude: E
LOC Altitude: 123
  Record name: test51
  LOC record: 49 11 42.400 N 16 E 123.00
[root@primenova ~]#


Verified: ipa-server-2.2.0-13.el6.x86_64

Comment 16 errata-xmlrpc 2012-06-20 13:18:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0819.html