#7009 ipa CLI does not check if machine is enrolled before attempting to contact IPA server
Closed: duplicate 6 years ago Opened 6 years ago by pvoborni.

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

Description of problem: pa CLI does not check if machine is enrolled before
attempting to contact IPA server


Version-Release number of selected component (if applicable):
ipa-server-4.5.0-13.el7.x86_64

How reproducible: Always

Steps to Reproduce:
1. Ensure that IPA server is not installed on a system
2. Now try to run the below command.

#ipa trust-add --type=ad ipaad2008r2.test --admin Administrator --password
--two-way=True --server=zombie.ipaad2008r2.test


Actual results:
[root@autohv02 ~]# ipa trust-add --type=ad ipaad2008r2.test --admin
Administrator --password --two-way=True --server=zombie.ipaad2008r2.test
ipa: ERROR: IOError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipalib/cli.py", line 1348, in run
    api.finalize()
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 714, in
finalize
    self.__do_if_not_done('load_plugins')
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 421, in
__do_if_not_done
    getattr(self, name)()
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 592, in
load_plugins
    for package in self.packages:
  File "/usr/lib/python2.7/site-packages/ipalib/__init__.py", line 948, in
packages
    ipaclient.remote_plugins.get_package(self),
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py",
line 126, in get_package
    plugins = schema.get_package(server_info, client)
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/schema.py",
line 534, in get_package
    schema = Schema(client)
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/schema.py",
line 385, in __init__
    fingerprint, ttl = self._fetch(client, ignore_cache=read_failed)
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/schema.py",
line 409, in _fetch
    schema = client.forward(u'schema', **kwargs)['result']
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1096, in forward
    return self._call_command(command, params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1077, in
_call_command
    return command(*params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1218, in _call
    return self.__request(name, args)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1185, in
__request
    verbose=self.__verbose >= 3,
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 672, in
single_request
    h = self.make_connection(host)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 549, in
make_connection
    tls_version_max=api.env.tls_version_max)
  File "/usr/lib/python2.7/site-packages/ipalib/util.py", line 322, in
create_https_connection
    ctx.load_verify_locations(cafile)
IOError: [Errno 2] No such file or directory
ipa: ERROR: an internal error has occurred

Expected results:
Fix the traceback with proper error message for e.g
"IPA is not configured on the system"


Additional info:

Metadata Update from @pvoborni:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1456595

6 years ago

Metadata Update from @pvoborni:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1456595

6 years ago

Metadata Update from @fbarreto:
- Issue assigned to fbarreto

6 years ago

Metadata Update from @frenaud:
- Issue close_status updated to: duplicate
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata