diff --git a/coverage2sql/db/api.py b/coverage2sql/db/api.py index 1545407..bc97914 100644 --- a/coverage2sql/db/api.py +++ b/coverage2sql/db/api.py @@ -12,19 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. -import collections -import datetime - from oslo_config import cfg from oslo_db.sqlalchemy import session as db_session import six -import sqlalchemy from sqlalchemy.engine.url import make_url import logging from coverage2sql.db import models -#from coverage2sql import exceptions CONF = cfg.CONF CONF.register_cli_opt(cfg.BoolOpt('verbose', short='v', default=False, diff --git a/coverage2sql/db/models.py b/coverage2sql/db/models.py index 24612aa..5533085 100644 --- a/coverage2sql/db/models.py +++ b/coverage2sql/db/models.py @@ -13,10 +13,7 @@ # under the License. import datetime -import uuid -#from oslo_db.sqlalchemy import models # noqa -import six import sqlalchemy as sa from sqlalchemy.ext import declarative diff --git a/coverage2sql/migrations/cli.py b/coverage2sql/migrations/cli.py index f7500e5..f4a0a33 100644 --- a/coverage2sql/migrations/cli.py +++ b/coverage2sql/migrations/cli.py @@ -21,7 +21,6 @@ from alembic import config as alembic_config from alembic import script as alembic_script from alembic import util as alembic_util from oslo_config import cfg -#from oslo_db import options from coverage2sql.db import api as db_api @@ -44,7 +43,6 @@ MIGRATION_OPTS = [ ] CONF = cfg.CONF -#CONF.register_cli_opts(options.database_opts, group='database') CONF.register_cli_opts(MIGRATION_OPTS) CONF.import_opt('verbose', 'coverage2sql.db.api') @@ -97,7 +95,7 @@ def validate_head_file(config): head_path = os.path.join(script.versions, HEAD_FILENAME) if (os.path.isfile(head_path) and - open(head_path).read().strip() == script.get_current_head()): + open(head_path).read().strip() == script.get_current_head()): return else: alembic_util.err('HEAD file does not match migration timeline head') diff --git a/coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py b/coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py index c58047c..514927f 100644 --- a/coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py +++ b/coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py @@ -1,3 +1,18 @@ +# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. +# +# 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. + """Add coverages table Revision ID: 52dfb338f74e diff --git a/coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py b/coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py index b264cf3..4ae6dcf 100644 --- a/coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py +++ b/coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py @@ -1,3 +1,18 @@ +# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. +# +# 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. + """Add test_type column Revision ID: cb0e61ce633e diff --git a/coverage2sql/read_coverage.py b/coverage2sql/read_coverage.py index ae61cfd..7aa1979 100644 --- a/coverage2sql/read_coverage.py +++ b/coverage2sql/read_coverage.py @@ -16,9 +16,7 @@ import coverage class DevNull(object): - """ - A file like '/dev/null' - """ + """A file like '/dev/null' """ def write(self, *args, **kwargs): pass diff --git a/coverage2sql/shell.py b/coverage2sql/shell.py index 0165002..975b32e 100644 --- a/coverage2sql/shell.py +++ b/coverage2sql/shell.py @@ -19,10 +19,8 @@ import sys from oslo_config import cfg from oslo_db import options from pbr import version -from stevedore import enabled from coverage2sql.db import api -# from coverage2sql import exceptions from coverage2sql import read_coverage as coverage CONF = cfg.CONF @@ -30,9 +28,9 @@ CONF.import_opt('verbose', 'coverage2sql.db.api') SHELL_OPTS = [ cfg.StrOpt('project_name', positional=True, required=True, - help='project name of the coverage files'), + help='project name of the coverage files'), cfg.StrOpt('coverage_file', positional=True, - help='A coverage file to put into the database'), + help='A coverage file to put into the database'), cfg.StrOpt('connection'), ] @@ -75,7 +73,7 @@ def main(): coverage_rate = cov.get_coverage_rate() else: raise NotImplementedError() - #cov = coverage.ReadCoverage(sys.stdin) + # cov = coverage.ReadCoverage(sys.stdin) process_results(project_name, coverage_rate)