diff --git a/HACKING.rst b/HACKING.rst index 28c9fc6..c405252 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,8 @@ -plasma Style Commandments -=============================================== +Valence Style Commandments +=========================== -Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ \ No newline at end of file +Read the OpenStack Style Commandments +http://docs.openstack.org/developer/hacking/ + +- [H305] Organize your imports according to 'Import order template' mentioned + in http://docs.openstack.org/developer/hacking/#import-order-template diff --git a/valence/api/app.py b/valence/api/app.py index 6800559..d3703a4 100644 --- a/valence/api/app.py +++ b/valence/api/app.py @@ -10,9 +10,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flask import Flask import logging from logging.handlers import RotatingFileHandler + +from flask import Flask + from valence import config as cfg _app = None diff --git a/valence/api/link.py b/valence/api/link.py index 5c8a79b..e753ab9 100644 --- a/valence/api/link.py +++ b/valence/api/link.py @@ -14,6 +14,7 @@ from flask import request + from valence.api import base from valence.api import types diff --git a/valence/api/root.py b/valence/api/root.py index dd2c78a..7d89135 100644 --- a/valence/api/root.py +++ b/valence/api/root.py @@ -12,11 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. +import json + from flask import abort from flask import request from flask import Response from flask_restful import Resource -import json + from valence.api import base from valence.api import link from valence.api import types diff --git a/valence/api/route.py b/valence/api/route.py index 213276c..2f459f7 100644 --- a/valence/api/route.py +++ b/valence/api/route.py @@ -14,6 +14,7 @@ from flask_cors import CORS from flask_restful import Api + from valence.api import app as flaskapp from valence.api.root import PODMProxy from valence.api.root import Root diff --git a/valence/api/types.py b/valence/api/types.py index 411a205..5b859bd 100644 --- a/valence/api/types.py +++ b/valence/api/types.py @@ -11,6 +11,7 @@ # under the License. import logging + import six LOG = logging.getLogger(__name__) diff --git a/valence/api/v1/flavor.py b/valence/api/v1/flavor.py index a1aba79..6863d61 100644 --- a/valence/api/v1/flavor.py +++ b/valence/api/v1/flavor.py @@ -12,9 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +import logging + from flask import request from flask_restful import Resource -import logging + from valence.flavor import flavor LOG = logging.getLogger(__name__) diff --git a/valence/api/v1/nodes.py b/valence/api/v1/nodes.py index 78a111a..e1d723a 100644 --- a/valence/api/v1/nodes.py +++ b/valence/api/v1/nodes.py @@ -12,11 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. +import logging from flask import request from flask_restful import abort from flask_restful import Resource -import logging + from valence.redfish import redfish as rfs LOG = logging.getLogger(__name__) diff --git a/valence/api/v1/storages.py b/valence/api/v1/storages.py index e0a9851..570d33b 100644 --- a/valence/api/v1/storages.py +++ b/valence/api/v1/storages.py @@ -12,9 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +import logging + from flask_restful import abort from flask_restful import Resource -import logging LOG = logging.getLogger(__name__) diff --git a/valence/api/v1/systems.py b/valence/api/v1/systems.py index 9bb6406..b76bf06 100644 --- a/valence/api/v1/systems.py +++ b/valence/api/v1/systems.py @@ -12,10 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +import logging from flask import request from flask_restful import Resource -import logging + from valence.redfish import redfish as rfs LOG = logging.getLogger(__name__) diff --git a/valence/api/v1/version.py b/valence/api/v1/version.py index 69b111e..7efcec9 100644 --- a/valence/api/v1/version.py +++ b/valence/api/v1/version.py @@ -12,10 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +import json from flask import request from flask_restful import Resource -import json + from valence.api import base from valence.api import link from valence.api import types diff --git a/valence/flavor/flavor.py b/valence/flavor/flavor.py index 528d1cd..bbf8f5b 100644 --- a/valence/flavor/flavor.py +++ b/valence/flavor/flavor.py @@ -15,6 +15,7 @@ from importlib import import_module import logging import os + from valence.redfish import redfish as rfs FLAVOR_PLUGIN_PATH = os.path.dirname(os.path.abspath(__file__)) + '/plugins' diff --git a/valence/redfish/redfish.py b/valence/redfish/redfish.py index 9312c5f..4f6ba36 100644 --- a/valence/redfish/redfish.py +++ b/valence/redfish/redfish.py @@ -16,8 +16,10 @@ import json import logging import os + import requests from requests.auth import HTTPBasicAuth + from valence import config as cfg from valence.redfish import tree