#5767 ipa-winsync-migrate: Traceback should be fixed with proper console output
Closed: Fixed Opened by pvoborni.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 7): Bug 1319003

Description of problem: ipa-winsync-migrate: Traceback should be fixed with
proper console output
Version-Release number of selected component (if applicable):
ipa-server-trust-ad-4.2.0-15.el7_2.10.x86_64
ipa-server-4.2.0-15.el7_2.10.x86_64
How reproducible:Always.
Steps to Reproduce:
1. Ensure ipa related rpms are installed.
2. Ensure ipa-server-install is not run.
3. Now try to run command 'ipa-replica-prepare' and check console output.
4. Now try to run command 'ipa-winsync-migrate' and check console output.
Actual results:
Step3:
[root@host2 ipa-idoverride]# ipa-replica-prepare
IPA is not configured on this system.
Step4:
[root@host2 ~]# ipa-winsync-migrate
ipa: WARNING: session memcached servers not running
Traceback (most recent call last):
  File "/usr/sbin/ipa-winsync-migrate", line 23, in <module>
    WinsyncMigrate.run_cli()
  File "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 124, in
run_cli
    sys.exit(cls.main(sys.argv))
  File
"/usr/lib/python2.7/site-packages/ipaserver/install/ipa_winsync_migrate.py",
line 346, in main
    api.Backend.ldap2.connect(ccache)
  File "/usr/lib/python2.7/site-packages/ipalib/backend.py", line 63, in
connect
    conn = self.create_connection(*args, **kw)
  File "/usr/lib/python2.7/site-packages/ipaserver/plugins/ldap2.py", line 149,
in create_connection
    client_controls=clientctrls)
  File "/usr/lib/python2.7/site-packages/ipapython/ipaldap.py", line 1070, in
gssapi_bind
    '', auth_tokens, server_controls, client_controls)
  File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python2.7/site-packages/ipapython/ipaldap.py", line 975, in
error_handler
    error=info)
ipalib.errors.NetworkError: cannot connect to 'ldap://localhost:389':
Expected results:
When IPA server is not installed/configured and when commands are run on the
console, they should display message like "IPA is not configured" instead of
displaying a traceback on the console.
All other command line options display proper message on the console.
Additional info:

Seems to be duplicate of #5470

@pvoborni I believe that this ticket can be closed as it appears to already be fixed upstream in version 4.2.1.

4.4.0 was released, moving open tickets to 4.4.1

Already fixed according to comment 3 and https://bugzilla.redhat.com/show_bug.cgi?id=1319003#c4

Metadata Update from @pvoborni:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.4.1

Metadata