Update requirements, fix oslo imports and correct tests

Since Blazar was in Winter, lots of tech debt was added.

This big change is actually trying to provide a +1 from Jenkins voting jobs.
ie.

 - fix calls to oslo_config
 - correct unittests failing due to removed assert_called()
 - remove pep8 check for verifying blazar.conf (can be readded later)
 - fix oslo_messaging imports

Not sure it's fully functional, Tempest needs to be fixed too but I
hope the gate will allow that change to pass.

Change-Id: Ib70b5b48b47626fc2613ee894d1162219417994f
This commit is contained in:
Sylvain Bauza 2015-05-04 18:52:19 +00:00
parent e84096852f
commit 53059527c1
52 changed files with 83 additions and 76 deletions

View File

@ -16,7 +16,7 @@
import eventlet
import flask
from keystoneclient.middleware import auth_token
from oslo.config import cfg
from oslo_config import cfg
from werkzeug import exceptions as werkzeug_exceptions
from climate.api.v1.oshosts import v1_0 as host_api_v1_0

View File

@ -16,7 +16,7 @@
import traceback
import flask
from oslo import messaging
import oslo_messaging as messaging
from werkzeug import datastructures
from climate.api import context

View File

@ -14,7 +14,7 @@
# limitations under the License.
from keystoneclient.middleware import auth_token
from oslo.config import cfg
from oslo_config import cfg
import pecan
from climate.api.v2 import hooks

View File

@ -16,7 +16,7 @@
"""Version 2 of the API.
"""
from oslo.config import cfg
from oslo_config import cfg
import pecan
from pecan import rest
from stevedore import enabled

View File

@ -15,7 +15,7 @@
import abc
from oslo.config import cfg
from oslo_config import cfg
from pecan import rest
import six

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo.config import cfg
from oslo_config import cfg
from pecan import hooks
from climate.api import context

View File

@ -19,7 +19,7 @@ import sys
import eventlet
from eventlet import wsgi
from oslo.config import cfg
from oslo_config import cfg
gettext.install('climate', unicode=1)

View File

@ -18,7 +18,7 @@ import sys
import eventlet
eventlet.monkey_patch()
from oslo.config import cfg
from oslo_config import cfg
gettext.install('climate', unicode=1)

View File

@ -15,7 +15,7 @@
import socket
from oslo.config import cfg
from oslo_config import cfg
cli_opts = [
cfg.StrOpt('host', default=socket.gethostname(),

View File

@ -15,7 +15,7 @@
"""Base class for classes that need modular database access."""
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common import importutils

View File

@ -22,7 +22,7 @@ import os
from alembic import command as alembic_command
from alembic import config as alembic_config
from alembic import util as alembic_util
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common.db import options as db_options
gettext.install('climate', unicode=1)

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo.config import cfg
from oslo import messaging
from oslo_config import cfg
import oslo_messaging as messaging
opts = [
cfg.StrOpt('rpc_topic',

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo.config import cfg
from oslo_config import cfg
from climate import manager
from climate.utils import service

View File

@ -16,7 +16,7 @@
import datetime
import eventlet
from oslo.config import cfg
from oslo_config import cfg
import six
from stevedore import enabled

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from oslo import messaging
from oslo_config import cfg
import oslo_messaging as messaging
from climate.openstack.common import log

View File

@ -27,7 +27,7 @@ import socket
import sys
import textwrap
from oslo.config import cfg
from oslo_config import cfg
import six
import stevedore.named

View File

@ -12,7 +12,7 @@
import copy
from oslo.config import cfg
from oslo_config import cfg
database_opts = [

View File

@ -26,7 +26,7 @@ import socket
import time
import eventlet.wsgi
from oslo.config import cfg
from oslo_config import cfg
import routes
import routes.middleware
import six

View File

@ -27,7 +27,7 @@ import traceback
import eventlet
import eventlet.backdoor
import greenlet
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common.gettextutils import _LI
from climate.openstack.common import log as logging

View File

@ -16,7 +16,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import fixtures
from oslo.config import cfg
from oslo_config import cfg
import six

View File

@ -26,7 +26,7 @@ import threading
import time
import weakref
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common import fileutils
from climate.openstack.common.gettextutils import _, _LE, _LI

View File

@ -37,7 +37,7 @@ import re
import sys
import traceback
from oslo.config import cfg
from oslo_config import cfg
import six
from six import moves

View File

@ -16,7 +16,7 @@
import socket
import uuid
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common import context
from climate.openstack.common.gettextutils import _, _LE

View File

@ -79,7 +79,7 @@ import abc
import ast
import re
from oslo.config import cfg
from oslo_config import cfg
import six
import six.moves.urllib.parse as urlparse
import six.moves.urllib.request as urlrequest

View File

@ -35,7 +35,7 @@ except ImportError:
import eventlet
from eventlet import event
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common import eventlet_backdoor
from climate.openstack.common.gettextutils import _LE, _LI, _LW

View File

@ -15,7 +15,7 @@
import os
import ssl
from oslo.config import cfg
from oslo_config import cfg
from climate.openstack.common.gettextutils import _

View File

@ -15,7 +15,7 @@
import abc
from oslo.config import cfg
from oslo_config import cfg
import six
from climate.db import api as db_api

View File

@ -15,7 +15,7 @@
import eventlet
from novaclient import exceptions as nova_exceptions
from oslo.config import cfg
from oslo_config import cfg
from climate import exceptions as climate_exceptions
from climate.openstack.common import log as logging

View File

@ -18,7 +18,7 @@ import datetime
import json
import uuid
from oslo.config import cfg
from oslo_config import cfg
import six
from climate.db import api as db_api

View File

@ -17,7 +17,7 @@
import uuid as uuidgen
from novaclient import exceptions as nova_exceptions
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate.manager import exceptions as manager_exceptions

View File

@ -17,7 +17,7 @@
import functools
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate import exceptions

View File

@ -17,7 +17,7 @@ import fixtures
import tempfile
import testscenarios
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate.db.sqlalchemy import api as db_api

View File

@ -14,7 +14,7 @@
# limitations under the License.
"""Base classes for API tests."""
from oslo.config import cfg
from oslo_config import cfg
import pecan
import pecan.testing
import six

View File

@ -16,7 +16,7 @@
Tests for ACL. Checks whether certain kinds of requests
are blocked or allowed to be processed.
"""
from oslo.config import cfg
from oslo_config import cfg
from climate.api.v2 import app
from climate import policy

View File

@ -57,4 +57,4 @@ class RESTApiTestCase(tests.TestCase):
def test_computehosts_delete(self):
self.api.computehosts_delete(host_id=self.fake_id)
self.render.assert_called_once()
self.render.assert_called_once_with()

View File

@ -15,7 +15,7 @@
import flask
from keystoneclient.middleware import auth_token
from oslo.config import cfg
from oslo_config import cfg
from werkzeug import exceptions as werkzeug_exceptions
from climate.api.v1 import app

View File

@ -79,22 +79,24 @@ class UtilsTestCase(tests.TestCase):
def test_request_data_data(self):
self.request.parsed_data = "data"
self.utils.request_data()
self.request.assert_called_once()
self.assertEqual("data", self.utils.request_data())
def test_request_data_file(self):
self.request.file_upload = True
self.utils.request_data()
self.request.assert_called_once()
self.request.data = 'foo'
del self.request.parsed_data
flask.request.content_length = 1
self.assertEqual('foo', self.utils.request_data())
def test_request_data_length(self):
del self.request.parsed_data
self.request.content_length = 0
self.utils.request_data()
self.request.assert_called_once()
self.assertEqual({}, self.utils.request_data())
def test_get_request_args(self):
self.utils.get_request_args()
self.request.assert_called_once()
self.flask.request.args = 'foo'
self.assertEqual('foo', self.utils.get_request_args())
def test_abort_and_log(self):
self.utils.abort_and_log(400, "Funny error")

View File

@ -53,4 +53,4 @@ class RESTApiTestCase(tests.TestCase):
def test_leases_delete(self):
self.api.leases_delete(lease_id=self.fake_id)
self.render.assert_called_once()
self.render.assert_called_once_with()

View File

@ -31,7 +31,7 @@ import urlparse
from alembic import command
from alembic import config as alembic_config
from alembic import migration
from oslo.config import cfg
from oslo_config import cfg
import sqlalchemy
import sqlalchemy.exc

View File

@ -37,7 +37,7 @@ postgres=# create database openstack_citest with owner openstack_citest;
"""
from oslo.config import cfg
from oslo_config import cfg
import sqlalchemy
from climate.tests.db import migration

View File

@ -17,7 +17,7 @@ import datetime
import eventlet
import mock
from oslo.config import cfg
from oslo_config import cfg
from stevedore import enabled
import testtools

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from oslo import messaging
from oslo_config import cfg
import oslo_messaging as messaging
from climate.notification import notifier as notification
from climate import tests

View File

@ -17,7 +17,7 @@ import uuid as uuidgen
from novaclient import client as nova_client
from novaclient import exceptions as nova_exceptions
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate.manager import exceptions as manager_exceptions

View File

@ -15,7 +15,7 @@
"""Test of Policy Engine For Climate."""
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate import exceptions

View File

@ -15,7 +15,7 @@
from keystoneclient import client as keystone_client
from keystoneclient import exceptions as keystone_exception
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate.manager import exceptions as manager_exceptions

View File

@ -16,7 +16,7 @@
from novaclient import client as nova_client
from novaclient import exceptions as nova_exception
from novaclient.v1_1 import servers
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate.utils.openstack import base

View File

@ -17,8 +17,8 @@
import functools
from oslo.config import cfg
from oslo import messaging
from oslo_config import cfg
import oslo_messaging as messaging
from climate import context
from climate.openstack.common.gettextutils import _

View File

@ -15,7 +15,7 @@
import functools
from oslo.config import cfg
from oslo_config import cfg
from climate import context
from climate.utils.openstack import keystone

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from oslo_config import cfg
from tempest import config

View File

@ -1,21 +1,25 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr>=0.6,!=0.7,<1.0
alembic>=0.6.4
alembic>=0.8.0
Babel>=1.3
eventlet>=0.13.0
eventlet>=0.17.4
Flask>=0.10,<1.0
iso8601>=0.1.9
kombu>=2.4.8
oslo.config>=1.4.0.0a3
oslo.messaging>=1.4.0.0a3
kombu>=3.0.7
oslo.config>=2.3.0 # Apache-2.0
oslo.messaging>=1.16.0,!=1.17.0,!=1.17.1 # Apache-2.0
posix_ipc
python-novaclient>=2.17.0
netaddr>=0.7.6
python-keystoneclient>=0.10.0
pecan>=0.5.0
python-novaclient>=2.26.0
netaddr>=0.7.12,!=0.7.16
python-keystoneclient>=1.6.0
pecan>=1.0.0
sqlalchemy-migrate>=0.9.6
Routes>=1.12.3,!=2.0
SQLAlchemy>=0.8.4,<=0.8.99,>=0.9.7,<=0.9.99
stevedore>=0.14
SQLAlchemy>=0.9.9,<1.1.0
stevedore>=1.5.0 # Apache-2.0
WebOb>=1.2.3
WSME>=0.6

View File

@ -1,18 +1,20 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=0.8.0,<0.9
nose
mock>=1.0
mox>=0.5.3
sphinx>=1.1.2,!=1.2.0,<1.3
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
sphinxcontrib-httpdomain
sqlalchemy-migrate>=0.9.1
lockfile>=0.8
discover
fixtures>=0.3.14
testrepository>=0.0.18
testscenarios>=0.4
testtools>=0.9.34
testtools>=1.4.0
coverage>=3.6
pylint==0.25.2
pylint==1.4.4 # GNU GPL v2
sphinxcontrib-pecanwsme>=0.8

View File

@ -5,7 +5,7 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = pip install --allow-external oslo.messaging --allow-insecure oslo.messaging -U {opts} {packages}
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
setenv = VIRTUAL_ENV={envdir}
@ -23,7 +23,6 @@ commands =
[testenv:pep8]
commands = flake8 {posargs}
{toxinidir}/tools/config/check_uptodate.sh
[testenv:venv]
commands = {posargs}