From b817a17aa6706f030ac435141f4af38ff65e2d7d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 25 Mar 2016 11:52:20 -0400 Subject: [PATCH] Fixes some PEP8 and minor stuff --- .gitignore | 1 - README.md | 5 +++++ almanach/adapters/database_adapter.py | 1 - almanach/adapters/retry_adapter.py | 1 + almanach/api.py | 1 + almanach/collector.py | 1 + tests/adapters/test_database_adapter.py | 3 ++- tests/adapters/test_retry_adapter.py | 5 +++-- tests/api_test.py | 3 +-- tests/builder.py | 4 ++-- tests/core/test_controller.py | 4 ++-- tests/messages.py | 3 ++- 12 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 2ce4bcd..6a785d1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ *.pyc *.coverage *.egg* -.vagrant .DS_Store AUTHORS ChangeLog diff --git a/README.md b/README.md index 0688f93..cb258f2 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,8 @@ Almanach is composed of two parts: - **Collector**: listen for OpenStack events and store the relevant information in the database. - **REST API**: Expose the information collected to external systems. + +License +------- + +Almanach is distributed under Apache 2.0 LICENSE. diff --git a/almanach/adapters/database_adapter.py b/almanach/adapters/database_adapter.py index fde2947..8d7a049 100644 --- a/almanach/adapters/database_adapter.py +++ b/almanach/adapters/database_adapter.py @@ -13,7 +13,6 @@ # limitations under the License. import logging - import pymongo from pymongo.errors import ConfigurationError diff --git a/almanach/adapters/retry_adapter.py b/almanach/adapters/retry_adapter.py index df02082..f8468b9 100644 --- a/almanach/adapters/retry_adapter.py +++ b/almanach/adapters/retry_adapter.py @@ -14,6 +14,7 @@ import json import logging + from kombu import Exchange, Queue, Producer from almanach import config diff --git a/almanach/api.py b/almanach/api.py index 958054f..24d1e81 100644 --- a/almanach/api.py +++ b/almanach/api.py @@ -13,6 +13,7 @@ # limitations under the License. import logging + from flask import Flask from gunicorn.app.base import Application diff --git a/almanach/collector.py b/almanach/collector.py index f3746db..504500b 100644 --- a/almanach/collector.py +++ b/almanach/collector.py @@ -14,6 +14,7 @@ import logging import sys + from kombu import Connection from almanach import log_bootstrap diff --git a/tests/adapters/test_database_adapter.py b/tests/adapters/test_database_adapter.py index 3e1bd71..8836640 100644 --- a/tests/adapters/test_database_adapter.py +++ b/tests/adapters/test_database_adapter.py @@ -18,12 +18,13 @@ import mongomock from datetime import datetime from flexmock import flexmock, flexmock_teardown from hamcrest import assert_that, contains_inanyorder +from pymongo import MongoClient + from almanach.adapters.database_adapter import DatabaseAdapter from almanach.common.VolumeTypeNotFoundException import VolumeTypeNotFoundException from almanach.common.AlmanachException import AlmanachException from almanach import config from almanach.core.model import todict -from pymongo import MongoClient from tests.builder import a, instance, volume, volume_type diff --git a/tests/adapters/test_retry_adapter.py b/tests/adapters/test_retry_adapter.py index 44099d0..72cef87 100644 --- a/tests/adapters/test_retry_adapter.py +++ b/tests/adapters/test_retry_adapter.py @@ -13,13 +13,14 @@ # limitations under the License. import unittest + from kombu import Connection +from kombu.tests import mocks +from kombu.transport import pyamqp from flexmock import flexmock, flexmock_teardown from almanach import config from almanach.adapters.retry_adapter import RetryAdapter -from kombu.tests import mocks -from kombu.transport import pyamqp class BusAdapterTest(unittest.TestCase): diff --git a/tests/api_test.py b/tests/api_test.py index 59809d9..0b939bd 100644 --- a/tests/api_test.py +++ b/tests/api_test.py @@ -13,10 +13,9 @@ # limitations under the License. import json -from uuid import uuid4 - import flask +from uuid import uuid4 from unittest import TestCase from datetime import datetime from flexmock import flexmock, flexmock_teardown diff --git a/tests/builder.py b/tests/builder.py index a7e6460..4f922dd 100644 --- a/tests/builder.py +++ b/tests/builder.py @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from copy import copy +import pytz +from copy import copy from datetime import datetime from uuid import uuid4 from almanach.core.model import build_entity_from_dict, Instance, Volume, VolumeType -import pytz class Builder(object): diff --git a/tests/core/test_controller.py b/tests/core/test_controller.py index 2821b3a..faf2ad7 100644 --- a/tests/core/test_controller.py +++ b/tests/core/test_controller.py @@ -13,9 +13,9 @@ # limitations under the License. import unittest -from datetime import datetime, timedelta - import pytz + +from datetime import datetime, timedelta from dateutil import parser as date_parser from flexmock import flexmock, flexmock_teardown from nose.tools import assert_raises diff --git a/tests/messages.py b/tests/messages.py index e410174..e724af7 100644 --- a/tests/messages.py +++ b/tests/messages.py @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from datetime import datetime, timedelta import dateutil.parser import pytz +from datetime import datetime, timedelta + DEFAULT_VOLUME_TYPE = "5dadd67f-e21e-4c13-b278-c07b73b21250"