Bug 1451657

Summary: -v option is not working for db2ldif.pl
Product: Red Hat Enterprise Linux 7 Reporter: Amita Sharma <amsharma>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: amsharma, nkinder, rmeggins
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.6.1-14.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 21:16:38 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:
Embargoed:

Description Amita Sharma 2017-05-17 08:58:08 UTC
Description of problem:
-v option is not working for db2ldif.pl

Version-Release number of selected component (if applicable):
389-ds-base-1.3.6.1-13.el7.x86_64


How reproducible:
Always

Steps to Reproduce:
[0 root@qeos-41 /]# db2ldif.pl -v -n userRoot -a "/export/backup/"
ERROR - Unknown option: -v
Usage: db2ldif.pl [-v] [-Z serverID] [-D rootdn] { -w password | -w - | -j pwfilename }
                  [-P protocol] {-n backendname}* | {-s include}* [{-x exclude}*] [-h]
                  [-a filename] [-m] [-M] [-r] [-u] [-C] [-N] [-U] [-E] [-1] [-a filename]

Actual results:
ERROR - Unknown option: -v

Expected results:
It should give output in verbose mode.

Comment 2 Amita Sharma 2017-05-17 09:30:47 UTC
Also, -v option is missing from help and man page. But it is explained in our Admin guide.

Comment 3 mreynolds 2017-05-17 14:02:25 UTC
Yeah, the "-v" option should not be present in the perl scripts.  It is only used by the shell scripts.  So we need to remove it from the usage/man pages and the RHEL docs.

Comment 4 Amita Sharma 2017-05-17 14:58:08 UTC
But none of the shell scripts usage show -v options -

[0 root@qeos-41 ~]# db2ldif
Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}* [{-x excludesuffix}*] [-a outputfile]
               [-E] [-r] [-u] [-U] [-m] [-1] [-q] [-h]
Note: either "-n backend" or "-s includesuffix" is required.
Options:
        -Z serverID       - Server instance identifier
        -n backend        - Backend database name.  Example: userRoot
        -s inclduesuffix  - Suffix to include
        -x                - Suffix to exclude
        -a outputfile     - Name of the exported LDIF file
        -r                - Include replication data
        -E                - Decrypt attributes
        -u                - Do not export the nsUniqueId attribute
        -U                - Do not wrap long lines
        -m                - Do not base64 encode values
        -1                - Do not include version text
        -q                - Quiet mode - suppresses output
        -h                - Display usage

[0 root@qeos-41 ~]# bak2db
Usage: bak2db archivedir [-Z serverID] [-n backend] [-q] [-h]
Options:
        archivedir   - Directory where the archived backup is located
        -n backend   - Backend database name.  Example: userRoot
        -Z serverID  - Server instance identifier
        -q           - Quiet mode - suppresses output
        -h           - Display usage

Comment 5 mreynolds 2017-05-17 15:04:16 UTC
Yeah looks like we removed it from many of the scripts.  I'll address that as well.

Comment 6 mreynolds 2017-05-17 20:04:30 UTC
Upstream ticket:
https://pagure.io/389-ds-base/issue/49261

Comment 8 Amita Sharma 2017-05-30 08:58:57 UTC
[root@qeos-37 upstream]# rpm -qa | grep 389
389-ds-base-libs-1.3.6.1-15.el7.x86_64
389-ds-base-1.3.6.1-15.el7.x86_64
389-ds-base-snmp-1.3.6.1-15.el7.x86_64
389-ds-base-debuginfo-1.3.6.1-15.el7.x86_64


[root@qeos-37 upstream]# db2ldif.pl -v -n userRoot -a "/export/backup/"
ERROR - Unknown option: -v
Usage: db2ldif.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j pwfilename }
                  [-P protocol] {-n backendname}* | {-s include}* [{-x exclude}*] [-h]
                  [-a filename] [-m] [-M] [-r] [-u] [-C] [-N] [-U] [-E] [-1] [-a filename]
Options:
        -D rootdn       - Directory Manager
        -w password     - Directory Manager's password
        -w -            - Prompt for Directory Manager's password
        -Z serverID     - Server instance identifier
        -j pwfilename   - Read Directory Manager's password from file
        -n backendname  - Backend database name.  Example: userRoot
        -a filename     - Output ldif file
        -s include      - Included suffix(es)
        -x exclude      - Excluded suffix(es)
        -m              - Minimal base64 encoding
        -M              - Output ldif is stored in multiple files
                          these files are named : <instance>_<filename>
                          by default, all instances are stored in <filename>
        -r              - Export replication data
        -u              - Do not export unique id
        -C              - Use main db file only
        -N              - Suppress printing sequential number
        -U              - Output ldif is not folded
        -E              - Decrypt encrypted data when exporting
        -1              - Do not print version line
        -P protocol     - STARTTLS, LDAPS, LDAPI, LDAP (default: uses most secure protocol available)
        -h              - Display usage
[root@qeos-37 upstream]# db2ldif
Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}* [{-x excludesuffix}*] [-a outputfile]
               [-E] [-r] [-u] [-U] [-m] [-1] [-q] [-v] [-h]
Note: either "-n backend" or "-s includesuffix" is required.
Options:
        -Z serverID       - Server instance identifier
        -n backend        - Backend database name.  Example: userRoot
        -s inclduesuffix  - Suffix to include
        -x                - Suffix to exclude
        -a outputfile     - Name of the exported LDIF file
        -r                - Include replication data
        -E                - Decrypt attributes
        -u                - Do not export the nsUniqueId attribute
        -U                - Do not wrap long lines
        -m                - Do not base64 encode values
        -1                - Do not include version text
        -q                - Quiet mode - suppresses output
        -v                - Display version
        -h                - Display usage
[root@qeos-37 upstream]# db2ldif -v
Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}* [{-x excludesuffix}*] [-a outputfile]
               [-E] [-r] [-u] [-U] [-m] [-1] [-q] [-v] [-h]
Note: either "-n backend" or "-s includesuffix" is required.
Options:
        -Z serverID       - Server instance identifier
        -n backend        - Backend database name.  Example: userRoot
        -s inclduesuffix  - Suffix to include
        -x                - Suffix to exclude
        -a outputfile     - Name of the exported LDIF file
        -r                - Include replication data
        -E                - Decrypt attributes
        -u                - Do not export the nsUniqueId attribute
        -U                - Do not wrap long lines
        -m                - Do not base64 encode values
        -1                - Do not include version text
        -q                - Quiet mode - suppresses output
        -v                - Display version
        -h                - Display usage
[root@qeos-37 upstream]# db2ldif -v -n userRoot -a "/export/backup/"
Exported ldif file: /export/backup/
389 Project
389-Directory/1.3.6.1 B2017.143.155

[root@qeos-37 upstream]# bak2db
Usage: bak2db archivedir [-Z serverID] [-n backend] [-q] [-h]
Options:
        archivedir   - Directory where the archived backup is located
        -n backend   - Backend database name.  Example: userRoot
        -Z serverID  - Server instance identifier
        -q           - Quiet mode - suppresses output
        -h           - Display usage

Looks good, marking as VERIFIED.

Comment 9 errata-xmlrpc 2017-08-01 21:16:38 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.

https://access.redhat.com/errata/RHBA-2017:2086