summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Dague <sdague@linux.vnet.ibm.com>2013-01-08 17:00:49 -0500
committerSean Dague <sdague@linux.vnet.ibm.com>2013-01-09 15:47:22 -0500
commit296288222240338bae5c2edf533cf4e3b52b5da6 (patch)
treed8ff1ca20114e77f339aa47f9045688e500a6861
parentda1c8bdd5cde21f12d608b618ed9342baf760d65 (diff)
fix N402 for rest of nova
fix N402 (single line docstrings should end in a period) for rest of nova files Change-Id: I57d0d9ab01345dd83e544e476d79d2c2ca68ee51
-rw-r--r--nova/block_device.py8
-rw-r--r--nova/cert/manager.py6
-rw-r--r--nova/image/glance.py4
-rw-r--r--nova/image/s3.py2
-rw-r--r--nova/ipv6/account_identifier.py2
-rw-r--r--nova/ipv6/rfc2462.py2
-rw-r--r--nova/policy.py2
-rw-r--r--nova/rootwrap/filters.py16
-rw-r--r--nova/rootwrap/wrapper.py4
-rw-r--r--nova/service.py2
-rw-r--r--nova/servicegroup/api.py10
-rw-r--r--nova/servicegroup/db_driver.py2
-rw-r--r--nova/utils.py14
13 files changed, 37 insertions, 37 deletions
diff --git a/nova/block_device.py b/nova/block_device.py
index 7e1e5374a..c95961911 100644
--- a/nova/block_device.py
+++ b/nova/block_device.py
@@ -62,7 +62,7 @@ def is_swap_or_ephemeral(device_name):
def mappings_prepend_dev(mappings):
- """Prepend '/dev/' to 'device' entry of swap/ephemeral virtual type"""
+ """Prepend '/dev/' to 'device' entry of swap/ephemeral virtual type."""
for m in mappings:
virtual = m['virtual']
if (is_swap_or_ephemeral(virtual) and
@@ -75,7 +75,7 @@ _dev = re.compile('^/dev/')
def strip_dev(device_name):
- """remove leading '/dev/'"""
+ """remove leading '/dev/'."""
return _dev.sub('', device_name) if device_name else device_name
@@ -83,7 +83,7 @@ _pref = re.compile('^((x?v|s)d)')
def strip_prefix(device_name):
- """remove both leading /dev/ and xvd or sd or vd """
+ """remove both leading /dev/ and xvd or sd or vd."""
device_name = strip_dev(device_name)
return _pref.sub('', device_name)
@@ -139,7 +139,7 @@ def instance_block_mapping(instance, bdms):
def match_device(device):
- """Matches device name and returns prefix, suffix"""
+ """Matches device name and returns prefix, suffix."""
match = re.match("(^/dev/x{0,1}[a-z]{0,1}d{0,1})([a-z]+)[0-9]*$", device)
if not match:
return None
diff --git a/nova/cert/manager.py b/nova/cert/manager.py
index 3a00c47a6..d1ffbd5a7 100644
--- a/nova/cert/manager.py
+++ b/nova/cert/manager.py
@@ -52,15 +52,15 @@ class CertManager(manager.Manager):
return crypto.revoke_certs_by_user_and_project(user_id, project_id)
def generate_x509_cert(self, context, user_id, project_id):
- """Generate and sign a cert for user in project"""
+ """Generate and sign a cert for user in project."""
return crypto.generate_x509_cert(user_id, project_id)
def fetch_ca(self, context, project_id):
- """Get root ca for a project"""
+ """Get root ca for a project."""
return crypto.fetch_ca(project_id)
def fetch_crl(self, context, project_id):
- """Get crl for a project"""
+ """Get crl for a project."""
return crypto.fetch_crl(project_id)
def decrypt_text(self, context, project_id, text):
diff --git a/nova/image/glance.py b/nova/image/glance.py
index 6a5406d9e..423500ddf 100644
--- a/nova/image/glance.py
+++ b/nova/image/glance.py
@@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Implementation of an image service that uses Glance as the backend"""
+"""Implementation of an image service that uses Glance as the backend."""
from __future__ import absolute_import
@@ -95,7 +95,7 @@ def _parse_image_ref(image_href):
def _create_glance_client(context, host, port, use_ssl, version=1):
- """Instantiate a new glanceclient.Client object"""
+ """Instantiate a new glanceclient.Client object."""
if use_ssl:
scheme = 'https'
else:
diff --git a/nova/image/s3.py b/nova/image/s3.py
index 6cb5e74ac..547e19003 100644
--- a/nova/image/s3.py
+++ b/nova/image/s3.py
@@ -401,7 +401,7 @@ class S3ImageService(object):
@staticmethod
def _test_for_malicious_tarball(path, filename):
- """Raises exception if extracting tarball would escape extract path"""
+ """Raises exception if extracting tarball would escape extract path."""
tar_file = tarfile.open(filename, 'r|gz')
for n in tar_file.getnames():
if not os.path.abspath(os.path.join(path, n)).startswith(path):
diff --git a/nova/ipv6/account_identifier.py b/nova/ipv6/account_identifier.py
index 1b4c99fbb..d50a66949 100644
--- a/nova/ipv6/account_identifier.py
+++ b/nova/ipv6/account_identifier.py
@@ -17,7 +17,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""IPv6 address generation with account identifier embedded"""
+"""IPv6 address generation with account identifier embedded."""
import hashlib
import netaddr
diff --git a/nova/ipv6/rfc2462.py b/nova/ipv6/rfc2462.py
index dec0935f5..147fe6876 100644
--- a/nova/ipv6/rfc2462.py
+++ b/nova/ipv6/rfc2462.py
@@ -17,7 +17,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""RFC2462 style IPv6 address generation"""
+"""RFC2462 style IPv6 address generation."""
import netaddr
diff --git a/nova/policy.py b/nova/policy.py
index 5a300cfb2..27e261eac 100644
--- a/nova/policy.py
+++ b/nova/policy.py
@@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Policy Engine For Nova"""
+"""Policy Engine For Nova."""
import os.path
diff --git a/nova/rootwrap/filters.py b/nova/rootwrap/filters.py
index 632e8d5bc..8958f1ba1 100644
--- a/nova/rootwrap/filters.py
+++ b/nova/rootwrap/filters.py
@@ -20,7 +20,7 @@ import re
class CommandFilter(object):
- """Command filter only checking that the 1st argument matches exec_path"""
+ """Command filter only checking that the 1st argument matches exec_path."""
def __init__(self, exec_path, run_as, *args):
self.name = ''
@@ -30,7 +30,7 @@ class CommandFilter(object):
self.real_exec = None
def get_exec(self, exec_dirs=[]):
- """Returns existing executable, or empty string if none found"""
+ """Returns existing executable, or empty string if none found."""
if self.real_exec is not None:
return self.real_exec
self.real_exec = ""
@@ -46,7 +46,7 @@ class CommandFilter(object):
return self.real_exec
def match(self, userargs):
- """Only check that the first argument (command) matches exec_path"""
+ """Only check that the first argument (command) matches exec_path."""
if (os.path.basename(self.exec_path) == userargs[0]):
return True
return False
@@ -60,12 +60,12 @@ class CommandFilter(object):
return [to_exec] + userargs[1:]
def get_environment(self, userargs):
- """Returns specific environment to set, None if none"""
+ """Returns specific environment to set, None if none."""
return None
class RegExpFilter(CommandFilter):
- """Command filter doing regexp matching for every argument"""
+ """Command filter doing regexp matching for every argument."""
def match(self, userargs):
# Early skip if command or number of args don't match
@@ -89,7 +89,7 @@ class RegExpFilter(CommandFilter):
class DnsmasqFilter(CommandFilter):
- """Specific filter for the dnsmasq call (which includes env)"""
+ """Specific filter for the dnsmasq call (which includes env)."""
CONFIG_FILE_ARG = 'CONFIG_FILE'
@@ -114,7 +114,7 @@ class DnsmasqFilter(CommandFilter):
class DeprecatedDnsmasqFilter(DnsmasqFilter):
- """Variant of dnsmasq filter to support old-style FLAGFILE"""
+ """Variant of dnsmasq filter to support old-style FLAGFILE."""
CONFIG_FILE_ARG = 'FLAGFILE'
@@ -164,7 +164,7 @@ class KillFilter(CommandFilter):
class ReadFileFilter(CommandFilter):
- """Specific filter for the utils.read_file_as_root call"""
+ """Specific filter for the utils.read_file_as_root call."""
def __init__(self, file_path, *args):
self.file_path = file_path
diff --git a/nova/rootwrap/wrapper.py b/nova/rootwrap/wrapper.py
index 848538234..70bd63c47 100644
--- a/nova/rootwrap/wrapper.py
+++ b/nova/rootwrap/wrapper.py
@@ -93,7 +93,7 @@ def setup_syslog(execname, facility, level):
def build_filter(class_name, *args):
- """Returns a filter object of class class_name"""
+ """Returns a filter object of class class_name."""
if not hasattr(filters, class_name):
logging.warning("Skipping unknown filter class (%s) specified "
"in filter definitions" % class_name)
@@ -103,7 +103,7 @@ def build_filter(class_name, *args):
def load_filters(filters_path):
- """Load filters from a list of directories"""
+ """Load filters from a list of directories."""
filterlist = []
for filterdir in filters_path:
if not os.path.isdir(filterdir):
diff --git a/nova/service.py b/nova/service.py
index fb322b19a..41eb254b5 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -352,7 +352,7 @@ class ProcessLauncher(object):
return wrap
def wait(self):
- """Loop waiting on children to die and respawning as necessary"""
+ """Loop waiting on children to die and respawning as necessary."""
while self.running:
wrap = self._wait_child()
if not wrap:
diff --git a/nova/servicegroup/api.py b/nova/servicegroup/api.py
index 895fc8490..b9653e1e2 100644
--- a/nova/servicegroup/api.py
+++ b/nova/servicegroup/api.py
@@ -73,7 +73,7 @@ class API(object):
return self._driver.join(member_id, group_id, service)
def service_is_up(self, member):
- """Check if the given member is up"""
+ """Check if the given member is up."""
msg = _('Check if the given member [%s] is part of the '
'ServiceGroup, is up')
LOG.debug(msg, member)
@@ -106,19 +106,19 @@ class ServiceGroupDriver(object):
"""Base class for ServiceGroup drivers."""
def join(self, member_id, group_id, service=None):
- """Join the given service with it's group"""
+ """Join the given service with it's group."""
raise NotImplementedError()
def is_up(self, member):
- """Check whether the given member is up. """
+ """Check whether the given member is up."""
raise NotImplementedError()
def leave(self, member_id, group_id):
- """Remove the given member from the ServiceGroup monitoring"""
+ """Remove the given member from the ServiceGroup monitoring."""
raise NotImplementedError()
def get_all(self, group_id):
- """Returns ALL members of the given group"""
+ """Returns ALL members of the given group."""
raise NotImplementedError()
def get_one(self, group_id):
diff --git a/nova/servicegroup/db_driver.py b/nova/servicegroup/db_driver.py
index f859f9f8b..393943bdd 100644
--- a/nova/servicegroup/db_driver.py
+++ b/nova/servicegroup/db_driver.py
@@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__)
class DbDriver(api.ServiceGroupDriver):
def join(self, member_id, group_id, service=None):
- """Join the given service with it's group"""
+ """Join the given service with it's group."""
msg = _('DB_Driver: join new ServiceGroup member %(member_id)s to '
'the %(group_id)s group, service = %(service)s')
diff --git a/nova/utils.py b/nova/utils.py
index 20c291382..cbf01cab4 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -692,7 +692,7 @@ def to_bytes(text, default=0):
def delete_if_exists(pathname):
- """delete a file, but ignore file not found error"""
+ """delete a file, but ignore file not found error."""
try:
os.unlink(pathname)
@@ -848,7 +848,7 @@ def parse_server_string(server_str):
def bool_from_str(val):
- """Convert a string representation of a bool into a bool value"""
+ """Convert a string representation of a bool into a bool value."""
if not val:
return False
@@ -861,7 +861,7 @@ def bool_from_str(val):
def is_valid_boolstr(val):
- """Check if the provided string is a valid bool string or not. """
+ """Check if the provided string is a valid bool string or not."""
val = str(val).lower()
return val == 'true' or val == 'false' or \
val == 'yes' or val == 'no' or \
@@ -950,7 +950,7 @@ def monkey_patch():
def convert_to_list_dict(lst, label):
- """Convert a value or list into a list of dicts"""
+ """Convert a value or list into a list of dicts."""
if not lst:
return None
if not isinstance(lst, list):
@@ -959,7 +959,7 @@ def convert_to_list_dict(lst, label):
def timefunc(func):
- """Decorator that logs how long a particular function took to execute"""
+ """Decorator that logs how long a particular function took to execute."""
@functools.wraps(func)
def inner(*args, **kwargs):
start_time = time.time()
@@ -1000,7 +1000,7 @@ def make_dev_path(dev, partition=None, base='/dev'):
def total_seconds(td):
- """Local total_seconds implementation for compatibility with python 2.6"""
+ """Local total_seconds implementation for compatibility with python 2.6."""
if hasattr(td, 'total_seconds'):
return td.total_seconds()
else:
@@ -1167,7 +1167,7 @@ def strcmp_const_time(s1, s2):
def walk_class_hierarchy(clazz, encountered=None):
- """Walk class hierarchy, yielding most derived classes first"""
+ """Walk class hierarchy, yielding most derived classes first."""
if not encountered:
encountered = []
for subclass in clazz.__subclasses__():