Merge "Fix H404, H402, H405 errors in tacker code"

This commit is contained in:
Jenkins 2015-12-23 07:48:16 +00:00 committed by Gerrit Code Review
commit 605b163afb
16 changed files with 68 additions and 24 deletions

View File

@ -241,7 +241,9 @@ class MidonetInterfaceDriver(LinuxInterfaceDriver):
def plug(self, network_id, port_id, device_name, mac_address,
bridge=None, namespace=None, prefix=None):
"""This method is called by the Dhcp agent or by the L3 agent
"""Driver for creating an interface.
This method is called by the Dhcp agent or by the L3 agent
when a new network is created
"""
if not ip_lib.device_exists(device_name,

View File

@ -433,7 +433,9 @@ class IpRouteCommand(IpDeviceCommandBase):
return retval
def pullup_route(self, interface_name):
"""Ensures that the route entry for the interface is before all
"""Route entry pullup.
Ensures that the route entry for the interface is before all
others on the same subnet.
"""
device_list = []

View File

@ -39,7 +39,9 @@ class Request(wsgi.Request):
def Resource(controller, faults=None, deserializers=None, serializers=None):
"""Represents an API entity resource and the associated serialization and
"""API entity resource.
Represents an API entity resource and the associated serialization and
deserialization logic
"""
xml_deserializer = wsgi.XMLDeserializer(attributes.get_attr_metadata())

View File

@ -104,7 +104,9 @@ def get_notifier(service=None, host=None, publisher_id=None):
class PluginRpcSerializer(om_serializer.Serializer):
"""This serializer is used to convert RPC common context into
"""Serializer.
This serializer is used to convert RPC common context into
Tacker Context.
"""
def __init__(self, base):

View File

@ -25,7 +25,8 @@ LOG = logging.getLogger(__name__)
class RpcProxy(object):
'''
'''Emulates RpcProxy class behaviour using oslo.messaging.
This class is created to facilitate migration from oslo-incubator
RPC layer implementation to oslo.messaging and is intended to
emulate RpcProxy class behaviour using oslo.messaging API once the
@ -73,7 +74,8 @@ class RpcProxy(object):
class RpcCallback(object):
'''
'''Sets callback version using oslo.messaging API.
This class is created to facilitate migration from oslo-incubator
RPC layer implementation to oslo.messaging and is intended to set
callback version using oslo.messaging API once the migration is

View File

@ -191,7 +191,9 @@ class CommonDbMixin(object):
return None
def _filter_non_model_columns(self, data, model):
"""Remove all the attributes from data which are not columns of
"""Removes attributes from data.
Remove all the attributes from data which are not columns of
the model passed as second parameter.
"""
columns = [c.name for c in model.__table__.columns]

View File

@ -49,8 +49,8 @@ _ACTIVE_UPDATE_ERROR_DEAD = (
# db tables
class DeviceTemplate(model_base.BASE, models_v1.HasId, models_v1.HasTenant):
"""Represents template to create hosting device
"""
"""Represents template to create hosting device."""
# Descriptive name
name = sa.Column(sa.String(255))
description = sa.Column(sa.String(255))
@ -73,6 +73,7 @@ class DeviceTemplate(model_base.BASE, models_v1.HasId, models_v1.HasTenant):
class ServiceType(model_base.BASE, models_v1.HasId, models_v1.HasTenant):
"""Represents service type which hosting device provides.
Since a device may provide many services, This is one-to-many
relationship.
"""
@ -83,6 +84,7 @@ class ServiceType(model_base.BASE, models_v1.HasId, models_v1.HasTenant):
class DeviceTemplateAttribute(model_base.BASE, models_v1.HasId):
"""Represents attributes necessary for spinning up VM in (key, value) pair
key value pair is adopted for being agnostic to actuall manager of VMs
like nova, heat or others. e.g. image-id, flavor-id for Nova.
The interpretation is up to actual driver of hosting device.
@ -95,6 +97,7 @@ class DeviceTemplateAttribute(model_base.BASE, models_v1.HasId):
class Device(model_base.BASE, models_v1.HasTenant):
"""Represents devices that hosts services.
Here the term, 'VM', is intentionally avoided because it can be
VM or other container.
"""
@ -122,7 +125,8 @@ class Device(model_base.BASE, models_v1.HasTenant):
class DeviceAttribute(model_base.BASE, models_v1.HasId):
"""Represents kwargs necessary for spinning up VM in (key, value) pair
"""Represents kwargs necessary for spinning up VM in (key, value) pair.
key value pair is adopted for being agnostic to actuall manager of VMs
like nova, heat or others. e.g. image-id, flavor-id for Nova.
The interpretation is up to actual driver of hosting device.

View File

@ -395,7 +395,9 @@ def _extract_roles(rule, roles):
def get_admin_roles():
"""Return a list of roles which are granted admin rights according
"""Get Admin roles.
Return a list of roles which are granted admin rights according
to policy settings.
"""
# NOTE(salvatore-orlando): This function provides a solution for

View File

@ -26,6 +26,7 @@ class TestAttributes(base.BaseTestCase):
def _construct_dict_and_constraints(self):
"""Constructs a test dictionary and a definition of constraints.
:return: A (dictionary, constraint) tuple
"""
constraints = {'key1': {'type:values': ['val1', 'val2'],

View File

@ -38,7 +38,8 @@ class ChanceScheduler(object):
def schedule(self, plugin, context,
service_type, service_instance_id, name, service_context):
"""
"""Scheduler.
:param service_context: list of DeviceServiceContext
without service_instance_id
[{'network_id': network_id,

View File

@ -65,8 +65,9 @@ class DeviceMGMTAbstractDriver(extensions.PluginInterface):
pass
def mgmt_get_config(self, plugin, context, device):
"""
returns dict of file-like objects which will be passed to hosting
"""Get a dict of objects.
Returns dict of file-like objects which will be passed to hosting
device.
It depends on drivers how to use it.
for nova case, it can be used for meta data, file injection or

View File

@ -46,7 +46,7 @@ CONF.register_opts(OPTS, group='monitor')
class VNFMonitor(object):
"""VNF Monitor"""
"""VNF Monitor."""
_instance = None
_hosting_vnfs = dict() # device_id => dict of parameters

View File

@ -38,20 +38,45 @@ class VNFMonitorAbstractDriver(extensions.PluginInterface):
@abc.abstractmethod
def get_description(self):
"""Return description of VNF Monitor plugin."""
pass
def monitor_get_config(self, plugin, context, device):
"""
returns dict of monitor configuration data
"""Return dict of monitor configuration data.
:param plugin:
:param context:
:param device:
:returns: dict
:returns: dict of monitor configuration data
"""
return {}
@abc.abstractmethod
def monitor_url(self, plugin, context, device):
"""Return the url of device to monitor.
:param plugin:
:param context:
:param device:
:returns: string
:returns: url of device to monitor
"""
pass
@abc.abstractmethod
def monitor_call(self, device, kwargs):
"""Monitor.
Return boolean value True if VNF is healthy
or return a event string like 'failure' or 'calls-capacity-reached'
for specific VNF health condition.
:param device:
:param kwargs:
:returns: boolean
:returns: True if VNF is healthy
"""
pass
def monitor_service_driver(self, plugin, context, device,

View File

@ -101,8 +101,8 @@ class VNFMMgmtMixin(object):
class VNFMPlugin(vm_db.VNFMPluginDb, VNFMMgmtMixin):
"""ServiceVMPlugin which supports ServiceVM framework
"""
"""VNFMPlugin which supports VNFM framework."""
OPTS = [
cfg.ListOpt(
'infra_driver', default=['heat'],

View File

@ -83,7 +83,8 @@ LOG = logging.getLogger(__name__)
class WorkerService(object):
"""Wraps a worker to be handled by ProcessLauncher"""
"""Wraps a worker to be handled by ProcessLauncher."""
def __init__(self, service, application):
self._service = service
self._application = application

View File

@ -72,11 +72,8 @@ commands = {posargs}
# H104 file contains nothing but comments
# H237 module is removed in Python 3
# H302 import only modules
# H402 one line docstring needs punctuation
# H405 multi line docstring summary not separated with an empty line
# H904 Wrap long lines in parentheses instead of a backslash
# TODO(marun) H404 multi line docstring should start with a summary
ignore = E125,E126,E128,E129,E251,E265,E713,F402,F811,F812,H237,H302,H402,H404,H405,H904
ignore = E125,E126,E128,E129,E251,E265,E713,F402,F811,F812,H237,H302,H904
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,.ropeproject