From e815afb74fbfa5439cb317add56916e65d866dc3 Mon Sep 17 00:00:00 2001 From: git-harry Date: Wed, 24 Jun 2015 09:46:45 +0100 Subject: [PATCH] Remove generate_glance_url The function generate_glance_url is part of the inital fork from nova. It is only called once and that is by a unit test designed to test the function. This commit removes generate_glance_url and its associated test because they are not used by cinder. Change-Id: I02a3632d258b7555284e66368eaf17af3b4b0a2f --- cinder/tests/unit/test_utils.py | 6 ------ cinder/utils.py | 7 ------- 2 files changed, 13 deletions(-) diff --git a/cinder/tests/unit/test_utils.py b/cinder/tests/unit/test_utils.py index 38c4d5c46..b8a21f3f8 100644 --- a/cinder/tests/unit/test_utils.py +++ b/cinder/tests/unit/test_utils.py @@ -324,12 +324,6 @@ class GenericUtilsTestCase(test.TestCase): self.assertTrue(utils.is_valid_boolstr(0)) self.assertTrue(utils.is_valid_boolstr('0')) - def test_generate_glance_url(self): - generated_url = utils.generate_glance_url() - actual_url = "http://%s:%d" % (CONF.glance_host, - CONF.glance_port) - self.assertEqual(generated_url, actual_url) - @mock.patch('os.path.join', side_effect=lambda x, y: '/'.join((x, y))) def test_make_dev_path(self, mock_join): self.assertEqual('/dev/xvda', utils.make_dev_path('xvda')) diff --git a/cinder/utils.py b/cinder/utils.py index b204a62e8..d7bd9ae28 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -435,13 +435,6 @@ def monkey_patch(): decorator("%s.%s" % (module, key), func)) -def generate_glance_url(): - """Generate the URL to glance.""" - # TODO(jk0): This will eventually need to take SSL into consideration - # when supported in glance. - return "http://%s:%d" % (CONF.glance_host, CONF.glance_port) - - def make_dev_path(dev, partition=None, base='/dev'): """Return a path to a particular device. -- 2.45.2