diff --git a/ceilometer/nova_client.py b/ceilometer/nova_client.py index d250a4040a..0afb92b142 100644 --- a/ceilometer/nova_client.py +++ b/ceilometer/nova_client.py @@ -75,7 +75,7 @@ class Client(object): # nova adapter options region_name=conf.region_name, - endpoint_type=conf.interface, + interface=conf.interface, service_type=cfg.CONF.service_types.nova, # keystone adapter options diff --git a/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml b/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml index 742a38f05a..d18aad6017 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/api_events_no_data.yaml @@ -14,7 +14,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -68,7 +68,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -77,7 +77,7 @@ tests: - name: get events that match query via request data url: /v2/events request_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 X-Roles: admin X-User-Id: user1 X-Project-Id: project1 @@ -88,7 +88,7 @@ tests: type: string value: cookies_chocolate.chip response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -101,7 +101,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -110,7 +110,7 @@ tests: - name: get events that match bad query via request data url: /v2/events request_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 X-Roles: admin X-User-Id: user1 X-Project-Id: project1 @@ -121,7 +121,7 @@ tests: type: string value: cookies_chocolate.chip response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -130,7 +130,7 @@ tests: - name: get events that match bad query via request data malformed list url: /v2/events request_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 X-Roles: admin X-User-Id: user1 X-Project-Id: project1 @@ -172,7 +172,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -193,7 +193,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -205,6 +205,6 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" diff --git a/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml b/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml index ccb7ba282a..01082ff94f 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/api_events_with_data.yaml @@ -13,7 +13,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_json_paths: $.[0].event_type: cookies_chocolate.chip $.[0].traits.[0].value: chocolate.chip @@ -46,7 +46,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_json_paths: $.[0].event_type: cookies_chocolate.chip $.[0].traits.[0].value: chocolate.chip @@ -56,7 +56,7 @@ tests: - name: get events that match query via data url: /v2/events request_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 X-Roles: admin X-User-Id: user1 X-Project-Id: project1 @@ -67,7 +67,7 @@ tests: type: string value: cookies_chocolate.chip response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_json_paths: $.[0].event_type: cookies_chocolate.chip $.[0].traits.[0].value: chocolate.chip @@ -81,7 +81,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -90,7 +90,7 @@ tests: - name: get events that match bad query via data url: /v2/events request_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 X-Roles: admin X-User-Id: user1 X-Project-Id: project1 @@ -101,7 +101,7 @@ tests: type: string value: cookies_chocolate.chip response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -110,7 +110,7 @@ tests: - name: get events that match bad query via data list url: /v2/events request_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 X-Roles: admin X-User-Id: user1 X-Project-Id: project1 @@ -129,7 +129,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_json_paths: $.event_type: cookies_chocolate.chip $.traits.[0].value: chocolate.chip @@ -152,7 +152,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - cookies_chocolate.chip - cookies_peanut.butter @@ -184,7 +184,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_json_paths: $.[0].type: string $.[1].name: ate @@ -197,7 +197,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -210,7 +210,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_json_paths: $.[0].name: ate $.[0].value: '0' @@ -224,7 +224,7 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" @@ -237,6 +237,6 @@ tests: X-User-Id: user1 X-Project-Id: project1 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - "[]" diff --git a/ceilometer/tests/functional/gabbi/gabbits/basic.yaml b/ceilometer/tests/functional/gabbi/gabbits/basic.yaml index c2ad2c9970..2a67e51014 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/basic.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/basic.yaml @@ -10,7 +10,7 @@ tests: - name: quick root check url: / response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - '"base": "application/json"' response_json_paths: diff --git a/ceilometer/tests/functional/gabbi/gabbits/clean-samples.yaml b/ceilometer/tests/functional/gabbi/gabbits/clean-samples.yaml index a7cb23268f..0d5927a894 100644 --- a/ceilometer/tests/functional/gabbi/gabbits/clean-samples.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits/clean-samples.yaml @@ -33,7 +33,7 @@ tests: $.[0].counter_name: apples status: 201 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 # When POSTing a sample perhaps we should get back a location header # with the URI of the posted sample diff --git a/ceilometer/tests/functional/gabbi/gabbits_prefix/basic.yaml b/ceilometer/tests/functional/gabbi/gabbits_prefix/basic.yaml index 26c7b860e6..d9d2815ba7 100644 --- a/ceilometer/tests/functional/gabbi/gabbits_prefix/basic.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits_prefix/basic.yaml @@ -10,7 +10,7 @@ tests: - name: quick root check url: / response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 response_strings: - '"base": "application/json"' response_json_paths: diff --git a/ceilometer/tests/functional/gabbi/gabbits_prefix/clean-samples.yaml b/ceilometer/tests/functional/gabbi/gabbits_prefix/clean-samples.yaml index 83835670cc..61f7c816ae 100644 --- a/ceilometer/tests/functional/gabbi/gabbits_prefix/clean-samples.yaml +++ b/ceilometer/tests/functional/gabbi/gabbits_prefix/clean-samples.yaml @@ -34,7 +34,7 @@ tests: $.[0].counter_name: apples status: 201 response_headers: - content-type: application/json + content-type: application/json; charset=UTF-8 - name: get resources desc: get the resources that exist because of the sample diff --git a/ceilometer/tests/unit/agent/test_manager.py b/ceilometer/tests/unit/agent/test_manager.py index e3a1dde5ef..7bfd611f36 100644 --- a/ceilometer/tests/unit/agent/test_manager.py +++ b/ceilometer/tests/unit/agent/test_manager.py @@ -18,11 +18,13 @@ import shutil from keystoneclient import exceptions as ks_exceptions import mock +from novaclient import client as novaclient from oslo_config import fixture as fixture_config from oslo_service import service as os_service from oslo_utils import fileutils from oslotest import base from oslotest import mockpatch +import requests import six from stevedore import extension import yaml @@ -296,6 +298,11 @@ class TestRunTasks(agentbase.BaseAgentManagerTestCase): @mock.patch('ceilometer.agent.manager.LOG') @mock.patch('ceilometer.nova_client.LOG') def test_hardware_discover_fail_minimize_logs(self, novalog, baselog): + self.useFixture(mockpatch.PatchObject( + novaclient.HTTPClient, + 'authenticate', + side_effect=requests.ConnectionError)) + class PollsterHardware(agentbase.TestPollster): discovery = 'tripleo_overcloud_nodes' diff --git a/requirements.txt b/requirements.txt index 10fcb981c2..a0fbf4f13c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -42,7 +42,7 @@ sqlalchemy-migrate>=0.9.6 # Apache-2.0 stevedore>=1.5.0 # Apache-2.0 tooz>=1.28.0 # Apache-2.0 Werkzeug>=0.7 # BSD License -WebOb>=1.2.3 # MIT +WebOb>=1.2.3,<1.7.0 # MIT WSME>=0.8 # MIT # NOTE(jd) We do not import it directly, but WSME datetime string parsing # behaviour changes when this library is installed