Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no jira id]Remove flake8 chaos appear in ci builds. #1781

Open
wants to merge 1 commit into
base: 9.8-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions f5_openstack_agent/lbaasv2/drivers/bigip/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

import errno
# import errno
import inspect
import service_launcher
import sys
Expand Down Expand Up @@ -46,7 +46,7 @@
except Exception:
# m/n/o/p version
from neutron.agent.linux.interface import OPTS as INTERFACE_OPTS
except ImportError as Error:
except ImportError:
pass

import f5_openstack_agent.lbaasv2.drivers.bigip.agent_manager as manager
Expand Down Expand Up @@ -136,12 +136,13 @@ def handler(*args):

if __name__ == '__main__':
# Handle any missing dependency errors via oslo:
try:
Error
except NameError:
sys.exc_clear()
else:
# We already had an exception, ABORT!
LOG.exception(str(Error))
sys.exit(errno.ENOSYS)
# try:
# # Error
# pass
# except NameError:
# sys.exc_clear()
# else:
# # We already had an exception, ABORT!
# LOG.exception(str(Error))
# sys.exit(errno.ENOSYS)
main()
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ def delete_loadbalancer(self, context, loadbalancer, service):
"by exception: %s, delete loadbalancer in Neutron",
id, ex.response.content)
provision_status = constants_v2.F5_ACTIVE
except f5_ex.ProjectIDException as ex:
except f5_ex.ProjectIDException:
LOG.debug("Delete loadbalancer with ProjectIDException")
provision_status = constants_v2.F5_ACTIVE
except Exception as ex:
Expand Down Expand Up @@ -1753,7 +1753,7 @@ def delete_member(self, context, member, service):
LOG.debug("Finish to delete multiple members")
else:
LOG.debug("Finish to delete member %s", id)
except f5_ex.ProjectIDException as ex:
except f5_ex.ProjectIDException:
LOG.debug("Delete Member with ProjectIDException")
provision_status = constants_v2.F5_ACTIVE
except Exception as ex:
Expand Down
2 changes: 1 addition & 1 deletion f5_openstack_agent/lbaasv2/drivers/bigip/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def __init__(self, **kwargs):

if six.PY2:
def __unicode__(self):
return unicode(self.msg)
return self.msg

def __str__(self):
return self.msg
Expand Down
6 changes: 3 additions & 3 deletions f5_openstack_agent/lbaasv2/drivers/bigip/icontrol_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,14 +1497,14 @@ def purge_orphaned_l7_policy(self, tenant_id=None, l7_policy_id=None,
% (l7_policy_id, bigip.hostname))
else:
error = err
except Exception as exc:
except Exception as err:
error = err
if error:
kwargs = dict(
tenant_id=tenant_id, l7_policy_id=l7_policy_id,
hostname=bigip.hostname, listener_id=listener_id)
LOG.exception('Exception: purge_orphaned_l7_policy({}) '
'"{}"'.format(kwargs, exc))
'"{}"'.format(kwargs, error))

@serialized('purge_orphaned_loadbalancer')
@is_operational
Expand Down Expand Up @@ -2147,7 +2147,7 @@ def _common_service_handler(self, service,
LOG.debug(" _post_service_networking "
"took %.5f secs" % (time() - start_time))

except f5ex.NetworkNotReady as error:
except f5ex.NetworkNotReady:
pass
except Exception as err:
LOG.exception(err)
Expand Down
6 changes: 3 additions & 3 deletions f5_openstack_agent/lbaasv2/drivers/bigip/selfips.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ def get_selfip_addr(self, bigip, name, partition=const.DEFAULT_PARTITION):
err.response.status_code,
err.message))
except Exception as err:
LOG.exception("Error getting selfip address for %s.",
name)
LOG.exception("Error getting selfip address for %s: %s.",
(name, err.message))

return selfip_addr

Expand Down Expand Up @@ -398,4 +398,4 @@ def delete_selfip(self, bigip, name, partition=const.DEFAULT_PARTITION):

except Exception as err:
raise f5_ex.SelfIPDeleteException(
"Failed to delete selfip %s." % name)
"Failed to delete selfip %s: %s." % (name, err.message))
3 changes: 2 additions & 1 deletion f5_openstack_agent/lbaasv2/drivers/bigip/tenants.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def _remove_tenant_replication_mode(self, bigip, tenant_id):
except Exception as err:
LOG.debug(
"Folder deletion exception for tenant partition %s occurred. "
"Manual cleanup might be required." % (tenant_id))
"Manual cleanup might be required: %s" %
(tenant_id, err.message))

def _partition_empty(self, bigip, partition):
virtual_addresses = self.va_helper.get_resources(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class TestTLSCertParser(object):
def test_get_intermediates_pem_chain(self):
intermediates = [c for c in
get_intermediates_pems(samples.X509_IMDS)]
assert cmp(intermediates, samples.X509_IMDS_LIST) == 0
assert set(intermediates) == set(samples.X509_IMDS_LIST)

def test_get_intermediates_pkcs7_pem(self):
intermediates = [c for c in
get_intermediates_pems(samples.PKCS7_PEM)]
assert cmp(intermediates, samples.X509_IMDS_LIST) == 0
assert set(intermediates) == set(samples.X509_IMDS_LIST)

def test_get_intermediates_pkcs7_pem_bad(self):
intermeidates = get_intermediates_pems(samples.BAD_PKCS7_PEM)
Expand All @@ -43,7 +43,7 @@ def test_get_intermediates_pkcs7_pem_bad(self):
def test_get_intermediates_pkcs7_der(self):
intermediates = [c for c in
get_intermediates_pems(samples.PKCS7_DER)]
assert cmp(intermediates, samples.X509_IMDS_LIST) == 0
assert set(intermediates) == set(samples.X509_IMDS_LIST)

def test_get_intermediates_pkcs7_der_bad(self):
intermeidates = get_intermediates_pems(samples.BAD_PKCS7_DER)
Expand Down