summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openstack/common/db/sqlalchemy/models.py3
-rw-r--r--openstack/common/memorycache.py3
-rw-r--r--openstack/common/notifier/log_notifier.py4
-rw-r--r--openstack/common/rpc/common.py6
-rw-r--r--openstack/common/rpc/impl_kombu.py5
-rw-r--r--openstack/common/rpc/service.py3
-rw-r--r--openstack/common/scheduler/filters/capabilities_filter.py5
-rw-r--r--openstack/common/timeutils.py3
-rw-r--r--tests/unit/rpc/test_kombu.py3
-rw-r--r--tests/unit/scheduler/fake_hosts.py10
-rw-r--r--tests/unit/test_log.py3
-rw-r--r--tests/unit/test_notifier.py3
-rw-r--r--tox.ini2
13 files changed, 34 insertions, 19 deletions
diff --git a/openstack/common/db/sqlalchemy/models.py b/openstack/common/db/sqlalchemy/models.py
index 6638c83..f61bb39 100644
--- a/openstack/common/db/sqlalchemy/models.py
+++ b/openstack/common/db/sqlalchemy/models.py
@@ -81,7 +81,8 @@ class ModelBase(object):
def iteritems(self):
"""Make the model object behave like a dict.
- Includes attributes from joins."""
+ Includes attributes from joins.
+ """
local = dict(self)
joined = dict([(k, v) for k, v in self.__dict__.iteritems()
if not k[0] == '_'])
diff --git a/openstack/common/memorycache.py b/openstack/common/memorycache.py
index 23847e6..f60143a 100644
--- a/openstack/common/memorycache.py
+++ b/openstack/common/memorycache.py
@@ -57,7 +57,8 @@ class Client(object):
def get(self, key):
"""Retrieves the value for a key or None.
- this expunges expired keys during each get"""
+ This expunges expired keys during each get.
+ """
now = timeutils.utcnow_ts()
for k in self.cache.keys():
diff --git a/openstack/common/notifier/log_notifier.py b/openstack/common/notifier/log_notifier.py
index aa3bc0a..d3ef0ae 100644
--- a/openstack/common/notifier/log_notifier.py
+++ b/openstack/common/notifier/log_notifier.py
@@ -24,7 +24,9 @@ CONF = cfg.CONF
def notify(_context, message):
"""Notifies the recipient of the desired event given the model.
- Log notifications using openstack's default logging system"""
+
+ Log notifications using openstack's default logging system.
+ """
priority = message.get('priority',
CONF.default_notification_level)
diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py
index 5a7e525..28dcacd 100644
--- a/openstack/common/rpc/common.py
+++ b/openstack/common/rpc/common.py
@@ -417,7 +417,8 @@ class ClientException(Exception):
"""This encapsulates some actual exception that is expected to be
hit by an RPC proxy object. Merely instantiating it records the
current exception information, which will be passed back to the
- RPC client without exceptional logging."""
+ RPC client without exceptional logging.
+ """
def __init__(self):
self._exc_info = sys.exc_info()
@@ -438,7 +439,8 @@ def client_exceptions(*exceptions):
of expected exceptions that the RPC layer should not consider fatal,
and not log as if they were generated in a real error scenario. Note
that this will cause listed exceptions to be wrapped in a
- ClientException, which is used internally by the RPC layer."""
+ ClientException, which is used internally by the RPC layer.
+ """
def outer(func):
def inner(*args, **kwargs):
return catch_client_exception(exceptions, func, *args, **kwargs)
diff --git a/openstack/common/rpc/impl_kombu.py b/openstack/common/rpc/impl_kombu.py
index 0648e4b..0960b9a 100644
--- a/openstack/common/rpc/impl_kombu.py
+++ b/openstack/common/rpc/impl_kombu.py
@@ -447,8 +447,9 @@ class Connection(object):
self.reconnect()
def _fetch_ssl_params(self):
- """Handles fetching what ssl params
- should be used for the connection (if any)"""
+ """Handles fetching what ssl params should be used for the connection
+ (if any).
+ """
ssl_params = dict()
# http://docs.python.org/library/ssl.html - ssl.wrap_socket
diff --git a/openstack/common/rpc/service.py b/openstack/common/rpc/service.py
index 6b56ebb..3f51d0b 100644
--- a/openstack/common/rpc/service.py
+++ b/openstack/common/rpc/service.py
@@ -30,7 +30,8 @@ LOG = logging.getLogger(__name__)
class Service(service.Service):
"""Service object for binaries running on hosts.
- A service enables rpc by listening to queues based on topic and host."""
+ A service enables rpc by listening to queues based on topic and host.
+ """
def __init__(self, host, topic, manager=None):
super(Service, self).__init__()
self.host = host
diff --git a/openstack/common/scheduler/filters/capabilities_filter.py b/openstack/common/scheduler/filters/capabilities_filter.py
index df69955..89e2bdb 100644
--- a/openstack/common/scheduler/filters/capabilities_filter.py
+++ b/openstack/common/scheduler/filters/capabilities_filter.py
@@ -25,8 +25,9 @@ class CapabilitiesFilter(filters.BaseHostFilter):
"""HostFilter to work with resource (instance & volume) type records."""
def _satisfies_extra_specs(self, capabilities, resource_type):
- """Check that the capabilities provided by the services
- satisfy the extra specs associated with the instance type"""
+ """Check that the capabilities provided by the services satisfy
+ the extra specs associated with the instance type.
+ """
extra_specs = resource_type.get('extra_specs', [])
if not extra_specs:
return True
diff --git a/openstack/common/timeutils.py b/openstack/common/timeutils.py
index 6094365..cb17487 100644
--- a/openstack/common/timeutils.py
+++ b/openstack/common/timeutils.py
@@ -141,7 +141,8 @@ def clear_time_override():
def marshall_now(now=None):
"""Make an rpc-safe datetime with microseconds.
- Note: tzinfo is stripped, but not required for relative times."""
+ Note: tzinfo is stripped, but not required for relative times.
+ """
if not now:
now = utcnow()
return dict(day=now.day, month=now.month, year=now.year, hour=now.hour,
diff --git a/tests/unit/rpc/test_kombu.py b/tests/unit/rpc/test_kombu.py
index ebc29ea..a524c73 100644
--- a/tests/unit/rpc/test_kombu.py
+++ b/tests/unit/rpc/test_kombu.py
@@ -114,7 +114,8 @@ class RpcKombuTestCase(amqp.BaseRpcAMQPTestCase):
def test_message_ttl_on_timeout(self):
"""Test message ttl being set by request timeout. The message
- should die on the vine and never arrive."""
+ should die on the vine and never arrive.
+ """
conn = self.rpc.create_connection(FLAGS)
message = 'topic test message'
diff --git a/tests/unit/scheduler/fake_hosts.py b/tests/unit/scheduler/fake_hosts.py
index 248eb3d..b02aca4 100644
--- a/tests/unit/scheduler/fake_hosts.py
+++ b/tests/unit/scheduler/fake_hosts.py
@@ -18,10 +18,12 @@ Fakes For filters tests.
class FakeHostManager(object):
- """host1: free_ram_mb=1024-512-512=0, free_disk_gb=1024-512-512=0
- host2: free_ram_mb=2048-512=1536 free_disk_gb=2048-512=1536
- host3: free_ram_mb=4096-1024=3072 free_disk_gb=4096-1024=3072
- host4: free_ram_mb=8192 free_disk_gb=8192"""
+ """
+ host1: free_ram_mb=1024-512-512=0, free_disk_gb=1024-512-512=0
+ host2: free_ram_mb=2048-512=1536 free_disk_gb=2048-512=1536
+ host3: free_ram_mb=4096-1024=3072 free_disk_gb=4096-1024=3072
+ host4: free_ram_mb=8192 free_disk_gb=8192
+ """
def __init__(self):
self.service_states = {
diff --git a/tests/unit/test_log.py b/tests/unit/test_log.py
index 301e3a8..f87a1da 100644
--- a/tests/unit/test_log.py
+++ b/tests/unit/test_log.py
@@ -267,7 +267,8 @@ class ExceptionLoggingTestCase(test_utils.BaseTestCase):
class FancyRecordTestCase(test_utils.BaseTestCase):
"""Test how we handle fancy record keys that are not in the
- base python logging"""
+ base python logging.
+ """
def setUp(self):
super(FancyRecordTestCase, self).setUp()
diff --git a/tests/unit/test_notifier.py b/tests/unit/test_notifier.py
index 90d811f..b762d5e 100644
--- a/tests/unit/test_notifier.py
+++ b/tests/unit/test_notifier.py
@@ -54,7 +54,8 @@ class NotifierTestCase(test_utils.BaseTestCase):
def test_verify_message_format(self):
"""A test to ensure changing the message format is prohibitively
- annoying"""
+ annoying.
+ """
def message_assert(context, message):
fields = [('publisher_id', 'publisher_id'),
diff --git a/tox.ini b/tox.ini
index e81c668..2741620 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,7 +17,7 @@ commands =
[flake8]
show-source = True
-ignore = H202,H302,H304,H306,H402,H403,H404
+ignore = H202,H302,H304,H306,H402,H404
exclude = .venv,.tox,dist,doc,*.egg,.update-venv
[testenv:pep8]