From 5e65baadf11edf771966a58f4de968cc037ae3ad Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Mon, 1 Feb 2016 13:24:58 +0100 Subject: [PATCH] Removed all __init__ files from pep8 ignore Change-Id: I860a15614a522cfd01e0883f4cfeb539e04d6d48 Closes-bug: #1537051 --- solar/cli/__init__.py | 15 ++++++++++++++- solar/core/resource/__init__.py | 18 +++++++++++++++++- solar/core/transports/__init__.py | 14 ++++++++++++++ solar/core/transports/helpers/__init__.py | 14 +++++++++++++- solar/dblayer/__init__.py | 20 ++++++++++++++++++-- solar/events/__init__.py | 9 ++++++++- solar/orchestration/__init__.py | 2 +- solar/orchestration/executors/__init__.py | 8 ++++---- solar/orchestration/workers/__init__.py | 6 +++--- tox.ini | 4 ++-- 10 files changed, 94 insertions(+), 16 deletions(-) diff --git a/solar/cli/__init__.py b/solar/cli/__init__.py index 54174935..1f6e00f8 100644 --- a/solar/cli/__init__.py +++ b/solar/cli/__init__.py @@ -1 +1,14 @@ -from solar.dblayer import standalone_session_wrapper +# -*- coding: utf-8 -*- +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/solar/core/resource/__init__.py b/solar/core/resource/__init__.py index 0e288405..cbf9c53e 100644 --- a/solar/core/resource/__init__.py +++ b/solar/core/resource/__init__.py @@ -12,4 +12,20 @@ # License for the specific language governing permissions and limitations # under the License. -from .resource import Resource, load, load_all, validate_resources, load_by_tags, load_updated, RESOURCE_STATE +from solar.core.resource.resource import load +from solar.core.resource.resource import load_all +from solar.core.resource.resource import load_by_tags +from solar.core.resource.resource import load_updated +from solar.core.resource.resource import Resource +from solar.core.resource.resource import RESOURCE_STATE +from solar.core.resource.resource import validate_resources + +__all__ = [ + 'RESOURCE_STATE', + 'Resource', + 'load', + 'load_all', + 'load_by_tags', + 'load_updated', + 'validate_resources' +] diff --git a/solar/core/transports/__init__.py b/solar/core/transports/__init__.py index e69de29b..1f6e00f8 100644 --- a/solar/core/transports/__init__.py +++ b/solar/core/transports/__init__.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/solar/core/transports/helpers/__init__.py b/solar/core/transports/helpers/__init__.py index 8b137891..b5ff96e6 100644 --- a/solar/core/transports/helpers/__init__.py +++ b/solar/core/transports/helpers/__init__.py @@ -1 +1,13 @@ - +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. diff --git a/solar/dblayer/__init__.py b/solar/dblayer/__init__.py index fdea245a..ed3e383c 100644 --- a/solar/dblayer/__init__.py +++ b/solar/dblayer/__init__.py @@ -1,13 +1,29 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + try: - from gevent import monkey + from gevent import monkey # NOQA except ImportError: pass else: from solar.dblayer.gevent_patches import patch_all patch_all() -from solar.dblayer.model import ModelMeta from solar.config import C +from solar.dblayer.model import ModelMeta from solar.utils import parse_database_conn _connection, _connection_details = parse_database_conn(C.solar_db) diff --git a/solar/events/__init__.py b/solar/events/__init__.py index 7f27cfbb..0ed1152d 100644 --- a/solar/events/__init__.py +++ b/solar/events/__init__.py @@ -12,4 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from .api import * +from solar.events.api import add_dep +from solar.events.api import add_event +from solar.events.api import add_react +from solar.events.api import Dep +from solar.events.api import React + + +__all__ = ['add_dep', 'add_react', 'Dep', 'React', 'add_event'] diff --git a/solar/orchestration/__init__.py b/solar/orchestration/__init__.py index e27207bb..635f2a34 100644 --- a/solar/orchestration/__init__.py +++ b/solar/orchestration/__init__.py @@ -15,8 +15,8 @@ from solar.config import C from solar.core.log import log from solar.dblayer import ModelMeta -from solar.orchestration import extensions as loader from solar.orchestration.executors import Executor +from solar.orchestration import extensions as loader SCHEDULER_CLIENT = loader.get_client('scheduler') diff --git a/solar/orchestration/executors/__init__.py b/solar/orchestration/executors/__init__.py index 2eaf0b4f..b52354a4 100644 --- a/solar/orchestration/executors/__init__.py +++ b/solar/orchestration/executors/__init__.py @@ -19,10 +19,10 @@ from solar.config import C mgr = driver.DriverManager( - namespace='solar.orchestration.executors', - name=C.executor, - invoke_on_load=False, - ) + namespace='solar.orchestration.executors', + name=C.executor, + invoke_on_load=False, +) Client = mgr.driver.Client Executor = mgr.driver.Executor diff --git a/solar/orchestration/workers/__init__.py b/solar/orchestration/workers/__init__.py index 4534c9d8..8d97bd07 100644 --- a/solar/orchestration/workers/__init__.py +++ b/solar/orchestration/workers/__init__.py @@ -12,6 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -import solar.orchestration.workers.scheduler -import solar.orchestration.workers.system_log -import solar.orchestration.workers.tasks +import solar.orchestration.workers.scheduler # NOQA +import solar.orchestration.workers.system_log # NOQA +import solar.orchestration.workers.tasks # NOQA diff --git a/tox.ini b/tox.ini index 4c49b6a2..eeb6c132 100644 --- a/tox.ini +++ b/tox.ini @@ -71,8 +71,8 @@ envdir = devenv usedevelop = True [flake8] -ignore = H101,H236,E731,H405 -exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs,solar/ansible_library +ignore = H101,H236,E731,H405,H104 +exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,docs,solar/ansible_library show-pep8 = True show-source = True count = True