Untitled

 avatar
unknown
plain_text
2 years ago
7.0 kB
10
Indexable
In [3]: sys = arch.upload_archive()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 sys = arch.upload_archive()

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_ros/utils/archive.py:161, in ROSArchive.upload_archive(self, force, system, wait_for_ros, **kwargs)
    158     raise ValueError("archive_info should be 'dict' or 'box.Box'.")
    159 self.archive_info.update(_archive_info)
--> 161 if self.insight_id is None or force:
    162     ingress_api_client = self.application.ingress.rest_client.ingress_api
    163     ingress_api_client.upload_post(
    164         file=self.filename,
    165         content_type="application/vnd.redhat.advisor.payload+tgz",
    166     )

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_ros/utils/archive.py:65, in ROSArchive.insight_id(self)
     62 @property
     63 def insight_id(self):
     64     """Return insights_id that corresponds to the inventory_id."""
---> 65     results = self.application.host_inventory.rest_client.hosts_api.api_host_get_host_list(
     66         insights_id=self.machine_id
     67     )
     68     if results.count == 1:
     69         return results.results[0].id

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_host_inventory_api/api/hosts_api.py:667, in HostsApi.api_host_get_host_list(self, **kwargs)
    631 """Read the entire list of hosts  # noqa: E501
    632 
    633 Read the entire list of all hosts available to the account. <br /><br /> Required permissions: inventory:hosts:read  # noqa: E501
   (...)
    664          returns the request thread.
    665 """
    666 kwargs["_return_http_data_only"] = True
--> 667 return self.api_host_get_host_list_with_http_info(**kwargs)

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_host_inventory_api/api/hosts_api.py:847, in HostsApi.api_host_get_host_list_with_http_info(self, **kwargs)
    844 # Authentication setting
    845 auth_settings = ["ApiKeyAuth"]  # noqa: E501
--> 847 return self.api_client.call_api(
    848     "/hosts",
    849     "GET",
    850     path_params,
    851     query_params,
    852     header_params,
    853     body=body_params,
    854     post_params=form_params,
    855     files=local_var_files,
    856     response_type="HostQueryOutput",  # noqa: E501
    857     auth_settings=auth_settings,
    858     async_req=local_var_params.get("async_req"),
    859     _return_http_data_only=local_var_params.get("_return_http_data_only"),  # noqa: E501
    860     _preload_content=local_var_params.get("_preload_content", True),
    861     _hide_api_exception=local_var_params.get("_hide_api_exception", False),
    862     _request_timeout=local_var_params.get("_request_timeout"),
    863     collection_formats=collection_formats,
    864 )

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_host_inventory_api/api_client.py:383, in ApiClient.call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, async_req, _return_http_data_only, collection_formats, _preload_content, _hide_api_exception, _request_timeout, _host)
    346 """Makes the HTTP request (synchronous) and returns deserialized data.
    347 
    348 To make an async_req request, set the async_req parameter.
   (...)
    380     then the method will return the response directly.
    381 """
    382 if not async_req:
--> 383     return self.__call_api(
    384         resource_path,
    385         method,
    386         path_params,
    387         query_params,
    388         header_params,
    389         body,
    390         post_params,
    391         files,
    392         response_type,
    393         auth_settings,
    394         _return_http_data_only,
    395         collection_formats,
    396         _preload_content,
    397         _hide_api_exception,
    398         _request_timeout,
    399         _host,
    400     )
    401 return self.pool.apply_async(
    402     self.__call_api,
    403     (
   (...)
    420     ),
    421 )

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_host_inventory_api/api_client.py:175, in ApiClient.__call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _hide_api_exception, _request_timeout, _host)
    172     post_params.extend(self.files_parameters(files))
    174 # auth setting
--> 175 self.update_params_for_auth(header_params, query_params, auth_settings)
    177 # body
    178 if body:

File ~/iqe-tests/iqe-core/iqe/base/rest_client.py:23, in client_obj_maker.<locals>.make_obj.<locals>.IQEApiClient.update_params_for_auth(self, headers, *k, **kw)
     17 """
     18 this is a very ugly hack that rips out the real auth
     19 
     20 """
     22 if self.configuration.iqe_authz:
---> 23     self.configuration.iqe_authz(Namespace(headers=headers))
     24 else:
     25     super().update_params_for_auth(headers, *k, **kw)

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_jwt/__init__.py:136, in JwtAuth.__call__(self, r)
    135 def __call__(self, r):
--> 136     token = self.get_token()
    137     r.headers["Authorization"] = f"Bearer {token}"
    138     return r

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_jwt/__init__.py:109, in JwtAuth.get_token(self)
    107 if not self.token:
    108     logger.info("No access token, requesting...")
--> 109     self._get_jwt()
    110 elif self._refresh_token_expired:
    111     logger.info("Refresh token has expired, performing new auth...")

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_jwt/__init__.py:156, in JwtAuth._get_jwt(self)
    154     return
    155 else:
--> 156     self._rhsm_style()

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_jwt/__init__.py:218, in JwtAuth._rhsm_style(self)
    211 sess = requests.Session()
    212 data_refresh = {
    213     "client_id": self.client_id,
    214     "grant_type": "password",
    215     "username": self.username,
    216     "password": self.password,
    217 }
--> 218 self._refresh_token(sess, data_refresh)

File ~/iqe-tests/.iqe_venv/lib64/python3.8/site-packages/iqe_jwt/__init__.py:193, in JwtAuth._refresh_token(self, session, data_refresh)
    188         response_text = response.json()
    189         error_message = (
    190             f"Cannot get token, error: {response_text['error']},"
    191             f" reason:{response_text['error_description']}"
    192         )
--> 193         raise ValueError(error_message)
    195     response.raise_for_status()
    197 response_json = response.json()

ValueError: Cannot get token, error: unauthorized_client, reason:Client not allowed for direct access grants
Editor is loading...