summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorDirk Mueller <dirk@dmllr.de>2013-06-08 13:18:51 +0200
committerDirk Mueller <dirk@dmllr.de>2013-06-12 22:07:23 +0200
commit1bf87dda57b076e042301eeafa966283265d08cf (patch)
tree103b0d02f296210ca95f1ed117347ab5d2c948b2 /nova/utils.py
parent957bd5c780c83243c750c22925e8f61f683f2b03 (diff)
downloadnova-1bf87dda57b076e042301eeafa966283265d08cf.tar.gz
nova-1bf87dda57b076e042301eeafa966283265d08cf.tar.xz
nova-1bf87dda57b076e042301eeafa966283265d08cf.zip
Fix and enable H403 tests
Multi-line doc-strings should end on a new, separate line. Change-Id: I4cf0cfe92b634ef77971863a4df41ef43531bc20
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 9067488d5..338e4d880 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -208,7 +208,8 @@ def last_completed_audit_period(unit=None, before=None):
returns: 2 tuple of datetimes (begin, end)
The begin timestamp of this audit period is the same as the
- end of the previous."""
+ end of the previous.
+ """
if not unit:
unit = CONF.instance_usage_audit_period
@@ -637,8 +638,11 @@ def get_shortened_ipv6_cidr(address):
def is_valid_cidr(address):
- """Check if the provided ipv4 or ipv6 address is a valid
- CIDR address or not"""
+ """Check if address is valid
+
+ The provided address can be a IPv6 or a IPv4
+ CIDR address.
+ """
try:
# Validate the correct CIDR Address
netaddr.IPNetwork(address)
@@ -661,8 +665,10 @@ def is_valid_cidr(address):
def get_ip_version(network):
- """Returns the IP version of a network (IPv4 or IPv6). Raises
- AddrFormatError if invalid network."""
+ """Returns the IP version of a network (IPv4 or IPv6).
+
+ Raises AddrFormatError if invalid network.
+ """
if netaddr.IPNetwork(network).version == 6:
return "IPv6"
elif netaddr.IPNetwork(network).version == 4:
@@ -1062,7 +1068,8 @@ def get_wrapped_function(function):
class ExceptionHelper(object):
"""Class to wrap another and translate the ClientExceptions raised by its
- function calls to the actual ones"""
+ function calls to the actual ones.
+ """
def __init__(self, target):
self._target = target