Browse Source

Fix pep8 failures on stable/stein branch

We could spend the time to figure out how best to pin
things so we don't have these failures, but it's quicker
just to fix them since there's just a few.

Partial cherry-pick of ff50886d79

Change-Id: I86899a455ec9214c2492a173fd531801ac1a347d
changes/87/707687/1
Brian Haley 1 month ago
parent
commit
84020ae658
3 changed files with 6 additions and 6 deletions
  1. +3
    -3
      octavia/api/v2/controllers/listener.py
  2. +2
    -2
      octavia/tests/unit/certificates/generator/test_local.py
  3. +1
    -1
      octavia/tests/unit/test_hacking.py

+ 3
- 3
octavia/api/v2/controllers/listener.py View File

@@ -371,9 +371,9 @@ class ListenersController(base.BaseController):

# Make sure we have a client CA cert if they enable client auth
if ((listener.client_authentication != wtypes.Unset and
listener.client_authentication != constants.CLIENT_AUTH_NONE)
and not (db_listener.client_ca_tls_certificate_id or
listener.client_ca_tls_container_ref)):
listener.client_authentication != constants.CLIENT_AUTH_NONE) and
not (db_listener.client_ca_tls_certificate_id or
listener.client_ca_tls_container_ref)):
raise exceptions.ValidationException(detail=_(
"Client authentication setting %s requires a client CA "
"container reference.") %


+ 2
- 2
octavia/tests/unit/certificates/generator/test_local.py View File

@@ -81,7 +81,7 @@ class TestLocalGenerator(local_csr.BaseLocalCSRTestCase):
should_expire = (datetime.datetime.utcnow() +
datetime.timedelta(seconds=2 * 365 * 24 * 60 * 60))
diff = should_expire - cert.not_valid_after
self.assertTrue(diff < datetime.timedelta(seconds=10))
self.assertLess(diff, datetime.timedelta(seconds=10))

# Make sure this is a version 3 X509.
self.assertEqual('v3', cert.version.name)
@@ -126,7 +126,7 @@ class TestLocalGenerator(local_csr.BaseLocalCSRTestCase):
should_expire = (datetime.datetime.utcnow() +
datetime.timedelta(seconds=2 * 365 * 24 * 60 * 60))
diff = should_expire - cert.not_valid_after
self.assertTrue(diff < datetime.timedelta(seconds=10))
self.assertLess(diff, datetime.timedelta(seconds=10))

# Make sure this is a version 3 X509.
self.assertEqual('v3', cert.version.name)


+ 1
- 1
octavia/tests/unit/test_hacking.py View File

@@ -71,7 +71,7 @@ class HackingTestCase(base.BaseTestCase):
return check_fns

def test_factory(self):
self.assertTrue(len(self._get_factory_checks(checks.factory)) > 0)
self.assertGreater(len(self._get_factory_checks(checks.factory)), 0)

def test_assert_true_instance(self):
self.assertEqual(1, len(list(checks.assert_true_instance(


Loading…
Cancel
Save