HewlettPackard / python-ilorest-library

Python library for interacting with devices which support a Redfish Service
Apache License 2.0
189 stars 92 forks source link

rest: Check that ca_cert_data is not None #113

Closed JohnAZoidberg closed 3 years ago

JohnAZoidberg commented 3 years ago

The default value of this variable is None but you can't check foo in None:

root@9f485191af50:/# /redfish/upload_firmware_ilo_repository.py 
Traceback (most recent call last):
  File "/redfish/upload_firmware_ilo_repository.py", line 103, in <module>
    REDFISHOBJ = RedfishClient(base_url=SYSTEM_URL, username=LOGIN_ACCOUNT, \
  File "/usr/local/lib/python3.9/site-packages/redfish/rest/v1.py", line 481, in __init__
    super(RedfishClient, self).__init__(default_prefix='/redfish/v1/', is_redfish=True,
  File "/usr/local/lib/python3.9/site-packages/redfish/rest/v1.py", line 211, in __init__
    self.auth_type = self._get_auth_type(auth, ca_cert_data=ca_cert_data, **client_kwargs)
  File "/usr/local/lib/python3.9/site-packages/redfish/rest/v1.py", line 232, in _get_auth_type
    if 'cert_file' in ca_cert_data and ca_cert_data['cert_file']:
TypeError: argument of type 'NoneType' is not iterable

-----Synopsis of Commits Above-----

Please fill out the following when submitting the PR

Status

Additional High Level Description

A few sentences describing the overall goals of the pull request's commits.

Dependent PRs

List any PRs that must be merged together. (Tool dependent PRs SHOULD NOT occur.)

Before Status can be set to READY I have completed the following: