Blocks catching base Exception were replaced
with more constrained alternatives where possible.
Alternatives were chosen based on exceptions possibly
raised by calls within the `try` clause.
Logs were altered to reflect new situation.
string method format was used for new log calls.
Unit tests were adjusted accordingly.
This patch may cause uptick in unhadled exceptions,
as previously "hidden" issues become apparent.
Increase in the number of exceptions capture,
including potential hunk revert should be done with care however.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I24612700bcbd3e17685ae7a33a27f38a2055a0fb
Network environment validation fails when accessing value
with the key 'os_net_config' from the nic-config files.
Fix the dictionary keys needed to fetch the network
config from nic_data.
Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
Change-Id: I2ec628dd9c9cf14c0cd9d8ba30f53ac18efe115f
During RPM packaging SUSE CI where raising KeyError and
OSError [0].
[0] https://review.opendev.org/755159
Change-Id: I47e25d3c70183e7617e42ac83a55f3d6e4f7a70f
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.
We previously dropped the support of python 2.7 and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.
Change-Id: I19fbdebe406575d2567f98a322ff68e6e992fac7
Avoid dangerous file parsing and object serialization libraries.
yaml.load is the obvious function to use but it is dangerous[1]
Because yaml.load return Python object may be dangerous if you
receive a YAML document from an untrusted source such as the
Internet. The function yaml.safe_load limits this ability to
simple Python objects like integers or lists.
In addition, Bandit flags yaml.load() as security risk so replace
all occurrences with yaml.safe_load(). Thus I replace yaml.load()
with yaml.safe_load()
[1]https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html
Change-Id: Id83e2a28355ba09cf22ea4e422de9b39e4f03c5e
Closes-Bug: #1634265
This new library provides the common logic used by openstack
clients. Replacing the imports from openstackclient and cliff.
Depends-On-External: https://review.rdoproject.org/r/#/c/2088/
Depends-On: I095209c241876c6ab48595962e07144fc5cc34a6
Closes-Bug: #1620964
Change-Id: I103a13ff6c0af94b82f5e48652380adfbf331d34