diff --git a/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py b/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py index a326e0485..0027dd505 100644 --- a/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py +++ b/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py @@ -38,7 +38,7 @@ cfg.CONF.register_opts([ class SampleHandler(NotificationHandler): - """ Sample Handler """ + """Sample Handler""" __plugin_name__ = 'sample' def get_exchange_topics(self): diff --git a/designate/api/v1/__init__.py b/designate/api/v1/__init__.py index 3c3033063..e44b7d4a0 100644 --- a/designate/api/v1/__init__.py +++ b/designate/api/v1/__init__.py @@ -122,7 +122,7 @@ def factory(global_config, **local_conf): class UUIDConverter(BaseConverter): - """ Validates UUID URL paramaters """ + """Validates UUID URL paramaters""" def to_python(self, value): if not utils.is_uuid_like(value): diff --git a/designate/api/v2/controllers/blacklists.py b/designate/api/v2/controllers/blacklists.py index 37ede72f4..ab846a2ac 100644 --- a/designate/api/v2/controllers/blacklists.py +++ b/designate/api/v2/controllers/blacklists.py @@ -36,7 +36,7 @@ class BlacklistsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('blacklist_id') def get_one(self, blacklist_id): - """ Get Blacklist """ + """Get Blacklist""" request = pecan.request context = request.environ['context'] @@ -47,7 +47,7 @@ class BlacklistsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def get_all(self, **params): - """ List all Blacklisted Zones """ + """List all Blacklisted Zones""" request = pecan.request context = request.environ['context'] @@ -66,7 +66,7 @@ class BlacklistsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def post_all(self): - """ Create Blacklisted Zone """ + """Create Blacklisted Zone""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -95,7 +95,7 @@ class BlacklistsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json-patch+json') @utils.validate_uuid('blacklist_id') def patch_one(self, blacklist_id): - """ Update Blacklisted Zone """ + """Update Blacklisted Zone""" request = pecan.request context = request.environ['context'] body = request.body_dict @@ -127,7 +127,7 @@ class BlacklistsController(rest.RestController): @pecan.expose(template=None, content_type='application/json') @utils.validate_uuid('blacklist_id') def delete_one(self, blacklist_id): - """ Delete Blacklisted Zone """ + """Delete Blacklisted Zone""" request = pecan.request response = pecan.response context = request.environ['context'] diff --git a/designate/api/v2/controllers/extensions/quotas.py b/designate/api/v2/controllers/extensions/quotas.py index 6f6f0d8cf..38625272e 100644 --- a/designate/api/v2/controllers/extensions/quotas.py +++ b/designate/api/v2/controllers/extensions/quotas.py @@ -42,7 +42,7 @@ class QuotasController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def patch_one(self, tenant_id): - """ Modify a Quota """ + """Modify a Quota""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -65,7 +65,7 @@ class QuotasController(rest.RestController): @pecan.expose(template=None, content_type='application/json') def delete_one(self, tenant_id): - """ Reset to the Default Quotas """ + """Reset to the Default Quotas""" request = pecan.request response = pecan.response context = request.environ['context'] diff --git a/designate/api/v2/controllers/floatingips.py b/designate/api/v2/controllers/floatingips.py index e4589490a..7c91cf4c3 100644 --- a/designate/api/v2/controllers/floatingips.py +++ b/designate/api/v2/controllers/floatingips.py @@ -46,7 +46,7 @@ class FloatingIPController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def get_all(self, **params): - """ List Floating IP PTRs for a Tenant """ + """List Floating IP PTRs for a Tenant""" request = pecan.request context = request.environ['context'] diff --git a/designate/api/v2/controllers/records.py b/designate/api/v2/controllers/records.py index 4ad030d74..dba47a5c3 100644 --- a/designate/api/v2/controllers/records.py +++ b/designate/api/v2/controllers/records.py @@ -36,7 +36,7 @@ class RecordsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('zone_id', 'recordset_id', 'record_id') def get_one(self, zone_id, recordset_id, record_id): - """ Get Record """ + """Get Record""" request = pecan.request context = request.environ['context'] @@ -48,7 +48,7 @@ class RecordsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('zone_id', 'recordset_id') def get_all(self, zone_id, recordset_id, **params): - """ List Records """ + """List Records""" request = pecan.request context = request.environ['context'] @@ -72,7 +72,7 @@ class RecordsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('zone_id', 'recordset_id') def post_all(self, zone_id, recordset_id): - """ Create Record """ + """Create Record""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -105,7 +105,7 @@ class RecordsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json-patch+json') @utils.validate_uuid('zone_id', 'recordset_id', 'record_id') def patch_one(self, zone_id, recordset_id, record_id): - """ Update Record """ + """Update Record""" request = pecan.request context = request.environ['context'] body = request.body_dict @@ -140,7 +140,7 @@ class RecordsController(rest.RestController): @pecan.expose(template=None, content_type='application/json') @utils.validate_uuid('zone_id', 'recordset_id', 'record_id') def delete_one(self, zone_id, recordset_id, record_id): - """ Delete Record """ + """Delete Record""" request = pecan.request response = pecan.response context = request.environ['context'] diff --git a/designate/api/v2/controllers/recordsets.py b/designate/api/v2/controllers/recordsets.py index 8608a19a6..dc7415f6e 100644 --- a/designate/api/v2/controllers/recordsets.py +++ b/designate/api/v2/controllers/recordsets.py @@ -39,7 +39,7 @@ class RecordSetsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('zone_id', 'recordset_id') def get_one(self, zone_id, recordset_id): - """ Get RecordSet """ + """Get RecordSet""" request = pecan.request context = request.environ['context'] @@ -51,7 +51,7 @@ class RecordSetsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('zone_id') def get_all(self, zone_id, **params): - """ List RecordSets """ + """List RecordSets""" request = pecan.request context = request.environ['context'] @@ -73,7 +73,7 @@ class RecordSetsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('zone_id') def post_all(self, zone_id): - """ Create RecordSet """ + """Create RecordSet""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -102,7 +102,7 @@ class RecordSetsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json-patch+json') @utils.validate_uuid('zone_id', 'recordset_id') def patch_one(self, zone_id, recordset_id): - """ Update RecordSet """ + """Update RecordSet""" request = pecan.request context = request.environ['context'] body = request.body_dict @@ -134,7 +134,7 @@ class RecordSetsController(rest.RestController): @pecan.expose(template=None, content_type='application/json') @utils.validate_uuid('zone_id', 'recordset_id') def delete_one(self, zone_id, recordset_id): - """ Delete RecordSet """ + """Delete RecordSet""" request = pecan.request response = pecan.response context = request.environ['context'] diff --git a/designate/api/v2/controllers/tlds.py b/designate/api/v2/controllers/tlds.py index 2167b11eb..cd373b906 100644 --- a/designate/api/v2/controllers/tlds.py +++ b/designate/api/v2/controllers/tlds.py @@ -34,7 +34,7 @@ class TldsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') @utils.validate_uuid('tld_id') def get_one(self, tld_id): - """ Get Tld """ + """Get Tld""" request = pecan.request context = request.environ['context'] @@ -44,7 +44,7 @@ class TldsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def get_all(self, **params): - """ List Tlds """ + """List Tlds""" request = pecan.request context = request.environ['context'] @@ -63,7 +63,7 @@ class TldsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def post_all(self): - """ Create Tld """ + """Create Tld""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -88,7 +88,7 @@ class TldsController(rest.RestController): @pecan.expose(template='json:', content_type='application/json-patch+json') @utils.validate_uuid('tld_id') def patch_one(self, tld_id): - """ Update Tld """ + """Update Tld""" request = pecan.request context = request.environ['context'] body = request.body_dict @@ -118,7 +118,7 @@ class TldsController(rest.RestController): @pecan.expose(template=None, content_type='application/json') @utils.validate_uuid('tld_id') def delete_one(self, tld_id): - """ Delete Tld """ + """Delete Tld""" request = pecan.request response = pecan.response context = request.environ['context'] diff --git a/designate/api/v2/controllers/zones.py b/designate/api/v2/controllers/zones.py index cf3e1ce1f..86def7a5b 100644 --- a/designate/api/v2/controllers/zones.py +++ b/designate/api/v2/controllers/zones.py @@ -48,7 +48,7 @@ class ZonesController(rest.RestController): @pecan.expose(template=None, content_type='text/dns') @utils.validate_uuid('zone_id') def get_one(self, zone_id): - """ Get Zone """ + """Get Zone""" # TODO(kiall): Validate we have a sane UUID for zone_id request = pecan.request @@ -66,13 +66,13 @@ class ZonesController(rest.RestController): 'Accept must be text/dns or application/json') def _get_json(self, request, context, zone_id): - """ 'Normal' zone get """ + """'Normal' zone get""" zone = self.central_api.get_domain(context, zone_id) return self._view.show(context, request, zone) def _get_zonefile(self, request, context, zone_id): - """ Export zonefile """ + """Export zonefile""" servers = self.central_api.get_domain_servers(context, zone_id) domain = self.central_api.get_domain(context, zone_id) @@ -105,7 +105,7 @@ class ZonesController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def get_all(self, **params): - """ List Zones """ + """List Zones""" request = pecan.request context = request.environ['context'] @@ -123,7 +123,7 @@ class ZonesController(rest.RestController): @pecan.expose(template='json:', content_type='application/json') def post_all(self): - """ Create Zone """ + """Create Zone""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -136,7 +136,7 @@ class ZonesController(rest.RestController): 'Content-type must be text/dns or application/json') def _post_json(self, request, response, context): - """ 'Normal' zone creation """ + """'Normal' zone creation""" body = request.body_dict # Validate the request conforms to the schema @@ -163,7 +163,7 @@ class ZonesController(rest.RestController): return self._view.show(context, request, zone) def _post_zonefile(self, request, response, context): - """ Import Zone """ + """Import Zone""" dnspython_zone = self._parse_zonefile(request) # TODO(artom) This should probably be handled with transactions zone = self._create_zone(context, dnspython_zone) @@ -187,7 +187,7 @@ class ZonesController(rest.RestController): @pecan.expose(template='json:', content_type='application/json-patch+json') @utils.validate_uuid('zone_id') def patch_one(self, zone_id): - """ Update Zone """ + """Update Zone""" # TODO(kiall): This needs cleanup to say the least.. request = pecan.request context = request.environ['context'] @@ -235,7 +235,7 @@ class ZonesController(rest.RestController): @pecan.expose(template=None, content_type='application/json') @utils.validate_uuid('zone_id') def delete_one(self, zone_id): - """ Delete Zone """ + """Delete Zone""" request = pecan.request response = pecan.response context = request.environ['context'] @@ -256,7 +256,7 @@ class ZonesController(rest.RestController): # somewhere reusable. def _create_zone(self, context, dnspython_zone): - """ Creates the initial zone """ + """Creates the initial zone""" # dnspython never builds a zone with more than one SOA, even if we give # it a zonefile that contains more than one soa = dnspython_zone.get_rdataset(dnspython_zone.origin, 'SOA') @@ -289,7 +289,7 @@ class ZonesController(rest.RestController): } def _create_records(self, context, zone_id, dnspython_zone): - """ Creates the records """ + """Creates the records""" for record_name in dnspython_zone.nodes.keys(): for rdataset in dnspython_zone.nodes[record_name]: record_type = rdatatype.to_text(rdataset.rdtype) @@ -325,7 +325,7 @@ class ZonesController(rest.RestController): Record(**values)) def _parse_zonefile(self, request): - """ Parses a POSTed zonefile into a dnspython zone object """ + """Parses a POSTed zonefile into a dnspython zone object""" try: dnspython_zone = dnszone.from_text( request.body, diff --git a/designate/api/v2/views/base.py b/designate/api/v2/views/base.py index f51ee3cc3..40c9f2654 100644 --- a/designate/api/v2/views/base.py +++ b/designate/api/v2/views/base.py @@ -44,7 +44,7 @@ class BaseView(object): self.base_uri = CONF['service:api']['api_base_uri'].rstrip('/') def list(self, context, request, items, parents=None): - """ View of a list of items """ + """View of a list of items""" result = { "links": self._get_collection_links(request, items, parents) } @@ -59,15 +59,15 @@ class BaseView(object): return result def list_basic(self, context, request, items): - """ Non-detailed list of items """ + """Non-detailed list of items""" return [self.show_basic(context, request, i) for i in items] def list_detail(self, context, request, items): - """ Detailed list of items """ + """Detailed list of items""" return [self.show_detail(context, request, i) for i in items] def show(self, context, request, item): - """ Show a single item """ + """Show a single item""" result = {} if 'detail' in request.GET and request.GET['detail'] == 'yes': @@ -80,15 +80,15 @@ class BaseView(object): return result def show_basic(self, context, request, item): - """ Non-detailed view of a item """ + """Non-detailed view of a item""" raise NotImplementedError() def show_detail(self, context, request, item): - """ Detailed view of a item """ + """Detailed view of a item""" return self.show_basic(context, request, item) def _load(self, context, request, body, valid_keys): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" result = {} item = body[self._resource_name] error_keys = [] diff --git a/designate/api/v2/views/blacklists.py b/designate/api/v2/views/blacklists.py index a0c0cdddf..decdd1dfc 100644 --- a/designate/api/v2/views/blacklists.py +++ b/designate/api/v2/views/blacklists.py @@ -22,13 +22,13 @@ LOG = logging.getLogger(__name__) class BlacklistsView(base_view.BaseView): - """ Model a Blacklist API response as a python dictionary """ + """Model a Blacklist API response as a python dictionary""" _resource_name = 'blacklist' _collection_name = 'blacklists' def show_basic(self, context, request, blacklist): - """ Detailed view of a blacklisted zone """ + """Detailed view of a blacklisted zone""" return { "id": blacklist['id'], "pattern": blacklist['pattern'], @@ -39,6 +39,6 @@ class BlacklistsView(base_view.BaseView): } def load(self, context, request, body): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" valid_keys = ('pattern', 'description') return self._load(context, request, body, valid_keys) diff --git a/designate/api/v2/views/extensions/quotas.py b/designate/api/v2/views/extensions/quotas.py index 206c4f4a9..446ec64c2 100644 --- a/designate/api/v2/views/extensions/quotas.py +++ b/designate/api/v2/views/extensions/quotas.py @@ -21,13 +21,13 @@ LOG = logging.getLogger(__name__) class QuotasView(base_view.BaseView): - """ Model a Quota API response as a python dictionary """ + """Model a Quota API response as a python dictionary""" _resource_name = 'quota' _collection_name = 'quotas' def show_basic(self, context, request, quota): - """ Basic view of a quota """ + """Basic view of a quota""" return { "zones": quota['domains'], "zone_records": quota['domain_records'], @@ -36,7 +36,7 @@ class QuotasView(base_view.BaseView): } def load(self, context, request, body): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" valid_keys = ('domain_records', 'domain_recordsets', 'domains', 'recordset_records') diff --git a/designate/api/v2/views/floatingips.py b/designate/api/v2/views/floatingips.py index 6e0d5185d..4bd31dbbe 100644 --- a/designate/api/v2/views/floatingips.py +++ b/designate/api/v2/views/floatingips.py @@ -21,7 +21,7 @@ LOG = logging.getLogger(__name__) class FloatingIPView(base_view.BaseView): - """ Model a FloatingIP PTR record as a python dict """ + """Model a FloatingIP PTR record as a python dict""" _resource_name = 'floatingip' _collection_name = 'floatingips' diff --git a/designate/api/v2/views/limits.py b/designate/api/v2/views/limits.py index d7b863ed6..4f8899ad0 100644 --- a/designate/api/v2/views/limits.py +++ b/designate/api/v2/views/limits.py @@ -21,13 +21,13 @@ LOG = logging.getLogger(__name__) class LimitsView(base_view.BaseView): - """ Model a Limits API response as a python dictionary """ + """Model a Limits API response as a python dictionary""" _resource_name = 'limits' _collection_name = 'limits' def show_basic(self, context, request, absolute_limits): - """ Basic view of the limits """ + """Basic view of the limits""" return { "absolute": { diff --git a/designate/api/v2/views/nameservers.py b/designate/api/v2/views/nameservers.py index 03c020c00..dec1562fa 100644 --- a/designate/api/v2/views/nameservers.py +++ b/designate/api/v2/views/nameservers.py @@ -22,7 +22,7 @@ LOG = logging.getLogger(__name__) class NameServerView(base_view.BaseView): - """ Model a NameServer API response as a python dictionary """ + """Model a NameServer API response as a python dictionary""" _resource_name = 'nameserver' _collection_name = 'nameservers' @@ -35,7 +35,7 @@ class NameServerView(base_view.BaseView): return href.rstrip('?') def show_basic(self, context, request, nameserver): - """ Basic view of a nameserver """ + """Basic view of a nameserver""" return { "id": nameserver["id"], "name": nameserver["name"] diff --git a/designate/api/v2/views/records.py b/designate/api/v2/views/records.py index 1e811722b..538e70486 100644 --- a/designate/api/v2/views/records.py +++ b/designate/api/v2/views/records.py @@ -21,7 +21,7 @@ LOG = logging.getLogger(__name__) class RecordsView(base_view.BaseView): - """ Model a Record API response as a python dictionary """ + """Model a Record API response as a python dictionary""" _resource_name = 'record' _collection_name = 'records' @@ -36,7 +36,7 @@ class RecordsView(base_view.BaseView): return href.rstrip('?') def show_basic(self, context, request, record): - """ Basic view of a record """ + """Basic view of a record""" return { "id": record['id'], "recordset_id": record['recordset_id'], @@ -51,6 +51,6 @@ class RecordsView(base_view.BaseView): } def load(self, context, request, body): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" valid_keys = ('data', 'description') return self._load(context, request, body, valid_keys) diff --git a/designate/api/v2/views/recordsets.py b/designate/api/v2/views/recordsets.py index 44b65ba00..c497d8070 100644 --- a/designate/api/v2/views/recordsets.py +++ b/designate/api/v2/views/recordsets.py @@ -21,7 +21,7 @@ LOG = logging.getLogger(__name__) class RecordSetsView(base_view.BaseView): - """ Model a Zone API response as a python dictionary """ + """Model a Zone API response as a python dictionary""" _resource_name = 'recordset' _collection_name = 'recordsets' @@ -34,7 +34,7 @@ class RecordSetsView(base_view.BaseView): return href.rstrip('?') def show_basic(self, context, request, recordset): - """ Basic view of a recordset """ + """Basic view of a recordset""" return { "id": recordset['id'], "zone_id": recordset['domain_id'], @@ -50,6 +50,6 @@ class RecordSetsView(base_view.BaseView): } def load(self, context, request, body): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" valid_keys = ('name', 'type', 'ttl', 'description') return self._load(context, request, body, valid_keys) diff --git a/designate/api/v2/views/tlds.py b/designate/api/v2/views/tlds.py index a9ad2e6e7..7d833ff4c 100644 --- a/designate/api/v2/views/tlds.py +++ b/designate/api/v2/views/tlds.py @@ -20,13 +20,13 @@ LOG = logging.getLogger(__name__) class TldsView(base_view.BaseView): - """ Model a TLD API response as a python dictionary """ + """Model a TLD API response as a python dictionary""" _resource_name = 'tld' _collection_name = 'tlds' def show_basic(self, context, request, tld): - """ Basic view of a tld """ + """Basic view of a tld""" return { "id": tld['id'], "name": tld['name'], @@ -37,6 +37,6 @@ class TldsView(base_view.BaseView): } def load(self, context, request, body): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" valid_keys = ('name', 'description') return self._load(context, request, body, valid_keys) diff --git a/designate/api/v2/views/zones.py b/designate/api/v2/views/zones.py index 2fcdcdad5..265b16212 100644 --- a/designate/api/v2/views/zones.py +++ b/designate/api/v2/views/zones.py @@ -21,13 +21,13 @@ LOG = logging.getLogger(__name__) class ZonesView(base_view.BaseView): - """ Model a Zone API response as a python dictionary """ + """Model a Zone API response as a python dictionary""" _resource_name = 'zone' _collection_name = 'zones' def show_basic(self, context, request, zone): - """ Basic view of a zone """ + """Basic view of a zone""" # TODO(kiall): pool_id should not be hardcoded.. even temp :) return { "id": zone['id'], @@ -46,6 +46,6 @@ class ZonesView(base_view.BaseView): } def load(self, context, request, body): - """ Extract a "central" compatible dict from an API call """ + """Extract a "central" compatible dict from an API call""" valid_keys = ('name', 'email', 'description', 'ttl') return self._load(context, request, body, valid_keys) diff --git a/designate/backend/base.py b/designate/backend/base.py index 23516136e..ca661b053 100644 --- a/designate/backend/base.py +++ b/designate/backend/base.py @@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__) class Backend(DriverPlugin): - """ Base class for backend implementations """ + """Base class for backend implementations""" __plugin_type__ = 'backend' __plugin_ns__ = 'designate.backend' @@ -43,66 +43,66 @@ class Backend(DriverPlugin): pass def create_tsigkey(self, context, tsigkey): - """ Create a TSIG Key """ + """Create a TSIG Key""" raise exceptions.NotImplemented( 'TSIG is not supported by this backend') def update_tsigkey(self, context, tsigkey): - """ Update a TSIG Key """ + """Update a TSIG Key""" raise exceptions.NotImplemented( 'TSIG is not supported by this backend') def delete_tsigkey(self, context, tsigkey): - """ Delete a TSIG Key """ + """Delete a TSIG Key""" raise exceptions.NotImplemented( 'TSIG is not supported by this backend') @abc.abstractmethod def create_domain(self, context, domain): - """ Create a DNS domain """ + """Create a DNS domain""" @abc.abstractmethod def update_domain(self, context, domain): - """ Update a DNS domain """ + """Update a DNS domain""" @abc.abstractmethod def delete_domain(self, context, domain): - """ Delete a DNS domain """ + """Delete a DNS domain""" def create_recordset(self, context, domain, recordset): - """ Create a DNS recordset """ + """Create a DNS recordset""" @abc.abstractmethod def update_recordset(self, context, domain, recordset): - """ Update a DNS recordset """ + """Update a DNS recordset""" @abc.abstractmethod def delete_recordset(self, context, domain, recordset): - """ Delete a DNS recordset """ + """Delete a DNS recordset""" @abc.abstractmethod def create_record(self, context, domain, recordset, record): - """ Create a DNS record """ + """Create a DNS record""" @abc.abstractmethod def update_record(self, context, domain, recordset, record): - """ Update a DNS record """ + """Update a DNS record""" @abc.abstractmethod def delete_record(self, context, domain, recordset, record): - """ Delete a DNS record """ + """Delete a DNS record""" @abc.abstractmethod def create_server(self, context, server): - """ Create a DNS server """ + """Create a DNS server""" @abc.abstractmethod def update_server(self, context, server): - """ Update a DNS server """ + """Update a DNS server""" @abc.abstractmethod def delete_server(self, context, server): - """ Delete a DNS server """ + """Delete a DNS server""" def sync_domain(self, context, domain, rdata): """ @@ -152,7 +152,7 @@ class Backend(DriverPlugin): self.create_record(context, domain, recordset, record) def ping(self, context): - """ Ping the Backend service """ + """Ping the Backend service""" return { 'status': None diff --git a/designate/backend/impl_bind9.py b/designate/backend/impl_bind9.py index 1658f1e37..f5a95748b 100644 --- a/designate/backend/impl_bind9.py +++ b/designate/backend/impl_bind9.py @@ -128,7 +128,7 @@ class Bind9Backend(base.Backend): return rndc_call def _sync_delete_domain(self, domain, new_domain_flag=False): - """ Remove domain zone files and reload bind config """ + """Remove domain zone files and reload bind config""" LOG.debug('Delete Domain: %s' % domain['id']) output_folder = os.path.join(os.path.abspath(cfg.CONF.state_path), @@ -156,7 +156,7 @@ class Bind9Backend(base.Backend): shutil.copyfile(nzf_name[0], output_file) def _sync_domain(self, domain, new_domain_flag=False): - """ Sync a single domain's zone file and reload bind config """ + """Sync a single domain's zone file and reload bind config""" LOG.debug('Synchronising Domain: %s' % domain['id']) servers = self.central_service.find_servers(self.admin_context) diff --git a/designate/backend/impl_powerdns/__init__.py b/designate/backend/impl_powerdns/__init__.py index c307892c3..2c90ba1a4 100644 --- a/designate/backend/impl_powerdns/__init__.py +++ b/designate/backend/impl_powerdns/__init__.py @@ -64,7 +64,7 @@ class PowerDNSBackend(base.Backend): # TSIG Key Methods def create_tsigkey(self, context, tsigkey): - """ Create a TSIG Key """ + """Create a TSIG Key""" if tsigkey['algorithm'] not in TSIG_SUPPORTED_ALGORITHMS: raise exceptions.NotImplemented('Unsupported algorithm') @@ -104,7 +104,7 @@ class PowerDNSBackend(base.Backend): self.session.commit() def update_tsigkey(self, context, tsigkey): - """ Update a TSIG Key """ + """Update a TSIG Key""" tsigkey_m = self._get_tsigkey(tsigkey['id']) # Store a copy of the original name.. @@ -125,7 +125,7 @@ class PowerDNSBackend(base.Backend): .update(content=tsigkey['name']) def delete_tsigkey(self, context, tsigkey): - """ Delete a TSIG Key """ + """Delete a TSIG Key""" try: # Delete this TSIG Key itself tsigkey_m = self._get_tsigkey(tsigkey['id']) @@ -336,7 +336,7 @@ class PowerDNSBackend(base.Backend): record_m.save(self.session) def _update_domainmetadata(self, domain_id, kind, values=[], delete=True): - """ Updates a domain's metadata with new values """ + """Updates a domain's metadata with new values""" # Fetch all current metadata of the specified kind query = self.session.query(models.DomainMetadata) query = query.filter_by(domain_id=domain_id, kind=kind) diff --git a/designate/mdns/handler.py b/designate/mdns/handler.py index b5f804a5b..9fcd23990 100644 --- a/designate/mdns/handler.py +++ b/designate/mdns/handler.py @@ -48,7 +48,7 @@ class RequestHandler(object): return response.to_wire() def _handle_query(self, request): - """ Handle a DNS QUERY request """ + """Handle a DNS QUERY request""" response = dns.message.make_response(request) response.set_rcode(dns.rcode.SERVFAIL) diff --git a/designate/notification_handler/base.py b/designate/notification_handler/base.py index 9530278d1..2f02cafff 100644 --- a/designate/notification_handler/base.py +++ b/designate/notification_handler/base.py @@ -48,7 +48,7 @@ def get_ip_data(addr_dict): class NotificationHandler(ExtensionPlugin): - """ Base class for notification handlers """ + """Base class for notification handlers""" __plugin_ns__ = 'designate.notification.handler' __plugin_type__ = 'handler' @@ -71,7 +71,7 @@ class NotificationHandler(ExtensionPlugin): @abc.abstractmethod def process_notification(self, context, event_type, payload): - """ Processes a given notification """ + """Processes a given notification""" def get_domain(self, domain_id): """ diff --git a/designate/notification_handler/neutron.py b/designate/notification_handler/neutron.py index a80c1b4a0..f421c766f 100644 --- a/designate/notification_handler/neutron.py +++ b/designate/notification_handler/neutron.py @@ -35,7 +35,7 @@ cfg.CONF.register_opts([ class NeutronFloatingHandler(BaseAddressHandler): - """ Handler for Neutron's notifications """ + """Handler for Neutron's notifications""" __plugin_name__ = 'neutron_floatingip' def get_exchange_topics(self): diff --git a/designate/notification_handler/nova.py b/designate/notification_handler/nova.py index 8683dbbbc..476e3a26b 100644 --- a/designate/notification_handler/nova.py +++ b/designate/notification_handler/nova.py @@ -35,7 +35,7 @@ cfg.CONF.register_opts([ class NovaFixedHandler(BaseAddressHandler): - """ Handler for Nova's notifications """ + """Handler for Nova's notifications""" __plugin_name__ = 'nova_fixed' def get_exchange_topics(self): diff --git a/designate/objects/base.py b/designate/objects/base.py index 52b949772..a4d7af093 100644 --- a/designate/objects/base.py +++ b/designate/objects/base.py @@ -24,12 +24,12 @@ class NotSpecifiedSentinel: def get_attrname(name): - """ Return the mangled name of the attribute's underlying storage. """ + """Return the mangled name of the attribute's underlying storage.""" return '_%s' % name def make_class_properties(cls): - """ Build getter and setter methods for all the objects attributes """ + """Build getter and setter methods for all the objects attributes""" cls.FIELDS = list(cls.FIELDS) for supercls in cls.mro()[1:-1]: @@ -88,7 +88,7 @@ class DictObjectMixin(object): return self[key] def update(self, values): - """ Make the model object behave like a dict """ + """Make the model object behave like a dict""" for k, v in values.iteritems(): self[k] = v @@ -209,11 +209,11 @@ class DesignateObject(DictObjectMixin): return hasattr(self, get_attrname(name)) def obj_what_changed(self): - """ Returns a set of fields that have been modified. """ + """Returns a set of fields that have been modified.""" return set(self._obj_changes) def obj_get_changes(self): - """ Returns a dict of changed fields and their new values. """ + """Returns a dict of changed fields and their new values.""" changes = {} for key in self.obj_what_changed(): @@ -222,7 +222,7 @@ class DesignateObject(DictObjectMixin): return changes def obj_reset_changes(self, fields=None): - """ Reset the list of fields that have been changed. """ + """Reset the list of fields that have been changed.""" if fields: self._obj_changes -= set(fields) for field in fields: @@ -233,7 +233,7 @@ class DesignateObject(DictObjectMixin): self._obj_original_values = dict() def obj_get_original_value(self, field): - """ Returns the original value of a field. """ + """Returns the original value of a field.""" if field in self._obj_original_values.keys(): return self._obj_original_values[field] elif self.obj_attr_is_set(field): diff --git a/designate/plugin.py b/designate/plugin.py index 4745feb72..e239e24b2 100644 --- a/designate/plugin.py +++ b/designate/plugin.py @@ -64,7 +64,7 @@ class DriverPlugin(Plugin): @classmethod def get_driver(cls, name): - """ Load a single driver """ + """Load a single driver""" LOG.debug('Looking for driver %s in %s' % (name, cls.__plugin_ns__)) @@ -83,7 +83,7 @@ class ExtensionPlugin(Plugin): @classmethod def get_extensions(cls, enabled_extensions=None): - """ Load a series of extensions """ + """Load a series of extensions""" LOG.debug('Looking for extensions in %s' % cls.__plugin_ns__) diff --git a/designate/quota/base.py b/designate/quota/base.py index 13459968f..74da46c39 100644 --- a/designate/quota/base.py +++ b/designate/quota/base.py @@ -24,7 +24,7 @@ from designate.plugin import DriverPlugin @six.add_metaclass(abc.ABCMeta) class Quota(DriverPlugin): - """ Base class for quota plugins """ + """Base class for quota plugins""" __plugin_ns__ = 'designate.quota' __plugin_type__ = 'quota' diff --git a/designate/sink/service.py b/designate/sink/service.py index c5e193e6e..809cfa344 100644 --- a/designate/sink/service.py +++ b/designate/sink/service.py @@ -38,7 +38,7 @@ class Service(service.Service): self.subscribers = self._get_subscribers() def _init_extensions(self): - """ Loads and prepares all enabled extensions """ + """Loads and prepares all enabled extensions""" enabled_notification_handlers = \ cfg.CONF['service:sink'].enabled_notification_handlers diff --git a/designate/sqlalchemy/models.py b/designate/sqlalchemy/models.py index fdb8258db..ea2c46344 100644 --- a/designate/sqlalchemy/models.py +++ b/designate/sqlalchemy/models.py @@ -26,7 +26,7 @@ from designate import exceptions class Base(models.ModelBase): # TODO(ekarlso): Remove me when o.db patch lands for this. def save(self, session): - """ Save this object """ + """Save this object""" session.add(self) try: @@ -47,7 +47,7 @@ class SoftDeleteMixin(object): deleted_at = Column(DateTime, nullable=True, default=None) def soft_delete(self, session): - """ Mark this object as deleted. """ + """Mark this object as deleted.""" self.deleted = self.id.replace('-', '') self.deleted_at = timeutils.utcnow() diff --git a/designate/storage/__init__.py b/designate/storage/__init__.py index 8a78ecfe0..f37cf3625 100644 --- a/designate/storage/__init__.py +++ b/designate/storage/__init__.py @@ -20,7 +20,7 @@ LOG = logging.getLogger(__name__) def get_storage(storage_driver): - """ Return the engine class from the provided engine name """ + """Return the engine class from the provided engine name""" cls = Storage.get_driver(storage_driver) return cls() diff --git a/designate/storage/base.py b/designate/storage/base.py index 18d819aa4..565520c6d 100644 --- a/designate/storage/base.py +++ b/designate/storage/base.py @@ -23,7 +23,7 @@ from designate.plugin import DriverPlugin @six.add_metaclass(abc.ABCMeta) class Storage(DriverPlugin): - """ Base class for storage plugins """ + """Base class for storage plugins""" __plugin_ns__ = 'designate.storage' __plugin_type__ = 'storage' @@ -566,7 +566,7 @@ class Storage(DriverPlugin): """ def ping(self, context): - """ Ping the Storage connection """ + """Ping the Storage connection""" return { 'status': None } diff --git a/designate/storage/impl_sqlalchemy/__init__.py b/designate/storage/impl_sqlalchemy/__init__.py index c824a3dd8..7f790f3d2 100644 --- a/designate/storage/impl_sqlalchemy/__init__.py +++ b/designate/storage/impl_sqlalchemy/__init__.py @@ -41,7 +41,7 @@ cfg.CONF.register_opts(options.database_opts, group='storage:sqlalchemy') def _set_object_from_model(obj, model): - """ Update a DesignateObject with the values from a SQLA Model """ + """Update a DesignateObject with the values from a SQLA Model""" for fieldname in obj.FIELDS: if hasattr(model, fieldname): @@ -53,7 +53,7 @@ def _set_object_from_model(obj, model): class SQLAlchemyStorage(base.Storage): - """ SQLAlchemy connection """ + """SQLAlchemy connection""" __plugin_name__ = 'sqlalchemy' def __init__(self): @@ -72,11 +72,11 @@ class SQLAlchemyStorage(base.Storage): self.session.rollback() def setup_schema(self): - """ Semi-Private Method to create the database schema """ + """Semi-Private Method to create the database schema""" models.Base.metadata.create_all(self.session.bind) def teardown_schema(self): - """ Semi-Private Method to reset the database schema """ + """Semi-Private Method to reset the database schema""" models.Base.metadata.drop_all(self.session.bind) def _apply_criterion(self, model, query, criterion): diff --git a/designate/wsgi.py b/designate/wsgi.py index 3fdc41e96..9ce264db7 100644 --- a/designate/wsgi.py +++ b/designate/wsgi.py @@ -19,7 +19,7 @@ from designate.openstack.deprecated import wsgi class Middleware(wsgi.Middleware): @classmethod def factory(cls, global_config, **local_conf): - """ Used for paste app factories in paste.deploy config files """ + """Used for paste app factories in paste.deploy config files""" def _factory(app): return cls(app, **local_conf) diff --git a/tox.ini b/tox.ini index c1adef631..04e5f80e8 100644 --- a/tox.ini +++ b/tox.ini @@ -33,7 +33,6 @@ commands = {posargs} # H104 file contains nothing more than comments # H302 import only modules # H306 imports not in alphabetical order -# H401 docstring should not start with a space # H402 one line docstring needs punctuation # H404 multi line docstring should start with a summary # H405 multi line docstring summary not separated with an empty line @@ -41,7 +40,7 @@ commands = {posargs} # E126 continuation line over-indented for hanging indent # E128 continuation line under-indented for visual indent -ignore = H104,H302,H306,H401,H402,H404,H405,H904,E126,E128 +ignore = H104,H302,H306,H402,H404,H405,H904,E126,E128 builtins = _ exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*openstack/deprecated*,*lib/python*,*egg,build,tools