Merge "Remove unused methods"

This commit is contained in:
Jenkins 2014-07-08 03:06:30 +00:00 committed by Gerrit Code Review
commit 3e174591e3
4 changed files with 2 additions and 62 deletions

View File

@ -66,6 +66,8 @@ def _load_strategies():
_available_strategies = _load_strategies()
# TODO(kadachi): Not used but don't remove this until glance.store
# development/migration stage.
def verify_location_strategy(conf=None, strategies=_available_strategies):
"""Validate user configured 'location_strategy' option value."""
if not conf:

View File

@ -216,21 +216,6 @@ def image_meta_to_http_headers(image_meta):
return headers
def add_features_to_http_headers(features, headers):
"""
Adds additional headers representing glance features to be enabled.
:param headers: Base set of headers
:param features: Map of enabled features
"""
if features:
for k, v in features.items():
if k.lower() in FEATURE_BLACKLIST:
raise exception.UnsupportedHeaderFeature(feature=k)
if v is not None:
headers[k.lower()] = unicode(v)
def get_image_meta_from_headers(response):
"""
Processes HTTP headers from a supplied response that

View File

@ -25,7 +25,6 @@ import atexit
import datetime
import logging
import os
import re
import shutil
import signal
import socket
@ -847,43 +846,6 @@ class FunctionalTest(test_utils.BaseTestCase):
return msg if expect_launch else None
def reload_server(self,
server,
expect_launch,
expect_exit=True,
expected_exitcode=0,
**kwargs):
"""
Reload a running server
Any kwargs passed to this method will override the configuration
value in the conf file used in starting the server.
:param server: the server to launch
:param expect_launch: true iff the server is expected to
successfully start
:param expect_exit: true iff the launched process is expected
to exit in a timely fashion
:param expected_exitcode: expected exitcode from the launcher
"""
self.cleanup()
# Start up the requested server
exitcode, out, err = server.reload(expect_exit=expect_exit,
expected_exitcode=expected_exitcode,
**kwargs)
if expect_exit:
self.assertEqual(expected_exitcode, exitcode,
"Failed to spin up the requested server. "
"Got: %s" % err)
self.assertTrue(re.search("Restarting glance-[a-z]+ with", out))
self.launched_servers.append(server)
launch_msg = self.wait_for_servers([server], expect_launch)
self.assertTrue(launch_msg is None, launch_msg)
def stop_server(self, server, name):
"""
Called to stop a single server in a normal fashion using the

View File

@ -135,15 +135,6 @@ class TestUtils(test_utils.BaseTestCase):
self.assertRaises(webob.exc.HTTPBadRequest,
utils.get_image_meta_from_headers, resp)
def test_add_features_to_http_headers(self):
features_test1 = {'x-image-meta-size': 'test'}
url = ("http://glance.example.com/v1/"
"images/71c675ab-d94f-49cd-a114-e12490b328d9")
headers = {"x-image-meta-uri": url}
self.assertRaises(exception.UnsupportedHeaderFeature,
utils.add_features_to_http_headers,
features_test1, headers)
def test_image_meta(self):
image_meta = {'x-image-meta-size': 'test'}
image_meta_properties = {'properties': {'test': "test"}}