Trivial fix pep8 and typos

PEP 8: missing whitespace around operator
PEP 8: line too long (> 79 characters)

Change-Id: I90af58cd8a374f362ef6db62080ae60a80713c7d
This commit is contained in:
Ngo Quoc Cuong 2017-05-06 01:45:49 +07:00
parent 6a78cefd68
commit f565b4797f
17 changed files with 26 additions and 26 deletions

View File

@ -68,8 +68,8 @@ class PoolsController(rest.RestController):
def post_all(self):
"""Create a Pool"""
LOG.warning(_LW("Use of this API Method is DEPRICATED. This will have "
"unforseen side affects when used with the "
LOG.warning(_LW("Use of this API Method is DEPRECATED. This will have "
"unforeseen side affects when used with the "
"designate-manage pool commands"))
request = pecan.request
@ -100,8 +100,8 @@ class PoolsController(rest.RestController):
def patch_one(self, pool_id):
"""Update the specific pool"""
LOG.warning(_LW("Use of this API Method is DEPRICATED. This will have "
"unforseen side affects when used with the "
LOG.warning(_LW("Use of this API Method is DEPRECATED. This will have "
"unforeseen side affects when used with the "
"designate-manage pool commands"))
request = pecan.request
@ -132,8 +132,8 @@ class PoolsController(rest.RestController):
def delete_one(self, pool_id):
"""Delete the specific pool"""
LOG.warning(_LW("Use of this API Method is DEPRICATED. This will have "
"unforseen side affects when used with the "
LOG.warning(_LW("Use of this API Method is DEPRECATED. This will have "
"unforeseen side affects when used with the "
"designate-manage pool commands"))
request = pecan.request

View File

@ -56,7 +56,7 @@ class RestController(pecan.rest.RestController):
return pool_mgr_rpcapi.PoolManagerAPI.get_instance()
def _apply_filter_params(self, params, accepted_filters, criterion):
invalid=[]
invalid = []
for k in params:
if k in accepted_filters:
criterion[k] = params[k].replace("*", "%")

View File

@ -155,7 +155,7 @@ class DenominatorBackend(base.AgentBackend):
# Add records one by one.
for name, ttl, rtype, data in self._iterate_records(zone):
# Some providers do not support creationg of SOA record.
# Some providers do not support creation of SOA record.
rdatatype = dns.rdatatype.from_text(rtype)
if rdatatype == dns.rdatatype.SOA:
continue

View File

@ -111,9 +111,9 @@ class EnhancedDNSClient(object):
# Ensure Suds (or suds-jerko) have been installed
if SudsClient is None:
raise EnhancedDNSException(
"Dependancy missing, please install suds or suds-jurko")
"Dependency missing, please install suds or suds-jurko")
# Prepare a SUDS transport with the approperiate credentials
# Prepare a SUDS transport with the appropriate credentials
transport = EnhancedDNSHttpAuthenticated(
username=username,
password=password,
@ -197,7 +197,7 @@ class EnhancedDNSClient(object):
try:
self.client.service.deleteZones(zoneNames=zoneNames)
except Exception as e:
# *READ THIS SECIION BEFORE MAKING ANY CHANGES*
# *READ THIS SECTION BEFORE MAKING ANY CHANGES*
# Added 01/2017 by Graham Hayes.
# If you have run a spell checking tool against the repo, and it
# changes the line below - the patch will get -2'd.

View File

@ -2655,7 +2655,7 @@ class Service(service.RPCService, service.Service):
request_body,
# Don't relativize, or we end up with '@' record names.
relativize=False,
# Dont check origin, we allow missing NS records
# Don't check origin, we allow missing NS records
# (missing SOA records are taken care of in _create_zone).
check_origin=False)
zone = dnsutils.from_dnspython_zone(dnspython_zone)

View File

@ -120,7 +120,7 @@ class hook_point(object):
def find_name(self, func=None):
"""Derive the hook target path from the function name, unless
a name has been passed in with the constuctor.
a name has been passed in with the constructor.
"""
if self._name:
return self._name

View File

@ -117,7 +117,7 @@ class NeutronNetworkAPI(base.NetworkAPI):
# activated in a particular region, we'll just log the failure
# and go on with our lives.
LOG.warning(_LW("Calling Neutron resulted in a 401, "
"please investigate."))
"please investigate."))
LOG.exception(e)
return
except Exception as e:
@ -145,7 +145,7 @@ class NeutronNetworkAPI(base.NetworkAPI):
# NOTE: Sadly tg code doesn't give us a good way to handle failures.
if failed:
msg = 'Failed retrieving FLoatingIPs from Neutron in %s' % \
msg = 'Failed retrieving FloatingIPs from Neutron in %s' % \
", ".join(['%s - %s' % (i[1], i[2]) for i in failed])
raise exceptions.NeutronCommunicationFailure(msg)
return data

View File

@ -626,7 +626,7 @@ class AttributeListObjectMixin(ListObjectMixin):
"""
Mixin class for "Attribute" objects.
Attribute objects are ListObjects, who's memebers have a "key" and "value"
Attribute objects are ListObjects, who's members have a "key" and "value"
property, which should be exposed on the list itself as list.<key>.
"""
@classmethod

View File

@ -503,7 +503,7 @@ class Service(service.RPCService, coordination.CoordinationMixin,
LOG.debug('Consensus reached for updating zone %(zone)s '
'on pool targets' % {'zone': zone.name})
# The zone status will be updated asyncronously by MiniDNS
# The zone status will be updated asynchronously by MiniDNS
# Send a NOTIFY to each also-notifies
for also_notify in self.pool.also_notifies:

View File

@ -248,8 +248,8 @@ class PeriodicSecondaryRefreshTask(PeriodicTask):
transferred = timeutils.parse_isotime(zone.transferred_at)
seconds = timeutils.delta_seconds(transferred, now)
if seconds > zone.refresh:
msg = "Zone %(id)s has %(seconds)d seconds since last transfer, " \
"executing AXFR"
msg = "Zone %(id)s has %(seconds)d seconds since last " \
"transfer, executing AXFR"
LOG.debug(msg, {"id": zone.id, "seconds": seconds})
self.central_api.xfr_zone(ctxt, zone.id)

View File

@ -40,7 +40,7 @@ class AttributeFilter(base.Filter):
"name": "example.com."
}
The zone attributes are matched against the potential pool candiates, and
The zone attributes are matched against the potential pool candidates, and
any pools that do not match **all** hints are removed.
.. warning::

View File

@ -31,7 +31,7 @@ class FallbackFilter(base.Filter):
.. note::
This should be used as one of the last filters, if you want to preserve
behavoir from before the scheduler existed.
behavior from before the scheduler existed.
"""
name = 'fallback'

View File

@ -53,7 +53,7 @@ class PoolIDAttributeFilter(base.Filter):
"""
def filter(self, context, pools, zone):
"""Attempt to load and set the pool to the one provied in the
"""Attempt to load and set the pool to the one provided in the
Zone attributes.
:param context: :class:`designate.context.DesignateContext` - Context

View File

@ -20,7 +20,7 @@ from jsonschema import compat
import netaddr
# NOTE(kiall): All of the below regular expressions are termined with
# NOTE(kiall): All of the below regular expressions are terminated with
# "\Z", rather than simply "$" to ensure a string with a
# trailing newline is NOT matched. See bug #1471158.

View File

@ -355,7 +355,7 @@ class DNSService(object):
Raises no exception: it's to be run in an eventlet green thread
:param addr: Tuple of the client's (IP addr, Port)
:type addr: tupple
:type addr: tuple
:param client: Client socket
:type client: socket
:raises: None

View File

@ -58,5 +58,5 @@ def upgrade(migrate_engine):
constraint.create()
except exc.IntegrityError as e:
LOG.error(explanation, e)
# Use sys.exit so we dont blow up with a huge trace
# Use sys.exit so we don't blow up with a huge trace
sys.exit(1)

View File

@ -47,7 +47,7 @@ SERVICE_STATES = [
metadata = MetaData()
# TODO(Federico) some default column values are not needed because we
# explicitely set the value on record insertion. Having default values could
# explicitly set the value on record insertion. Having default values could
# hide bugs.