Ejemplo n.º 1
0
    def _get_fake_client(cls):
        try:
            # ironic-inspector client tries to get and validate it's own
            # version when created. This might require checking the keystone
            # catalog if the ironic-inspector server is not listening on the
            # localhost IP address. Thus, we get a session for this case.
            sess = keystone_utils.get_admin_session()

            return cls._get_client_class()(session=sess)
        except Exception as e:
            LOG.warning("There was an error trying to create the "
                        "ironic-inspector client using a session: %s", str(e))
            # If it's not possible to establish a keystone session, attempt to
            # create a client without it. This should fall back to where the
            # ironic-inspector client tries to get it's own version on the
            # default IP address.
            LOG.debug("Attempting to create the ironic-inspector client "
                      "without a session.")

            return cls._get_client_class()()
Ejemplo n.º 2
0
 def _get_fake_client(cls):
     session = keystone_utils.get_admin_session()
     return cls._get_client_class()(
         endpoint_override="http://127.0.0.1:9517/",
         session=session
     )
Ejemplo n.º 3
0
 def _get_fake_client(cls):
     sess = keystone_utils.get_admin_session()
     return cls._get_client_class()(authenticator=sess.auth)