Browse Source

Drop param2id() from cmd/manage.py

The function is not used anywhere.

Change-Id: I799e73992faa387e56a793d60cc599039d268f81
Thomas Bechtold 3 months ago
parent
commit
0c177b902a
2 changed files with 0 additions and 31 deletions
  1. 0
    15
      manila/cmd/manage.py
  2. 0
    16
      manila/tests/cmd/test_manage.py

+ 0
- 15
manila/cmd/manage.py View File

@@ -60,7 +60,6 @@ import sys
60 60
 
61 61
 from oslo_config import cfg
62 62
 from oslo_log import log
63
-from oslo_utils import uuidutils
64 63
 
65 64
 from manila.common import config  # Need to register global_opts  # noqa
66 65
 from manila import context
@@ -91,20 +90,6 @@ def args(*args, **kwargs):
91 90
     return _decorator
92 91
 
93 92
 
94
-def param2id(object_id):
95
-    """Helper function to convert various id types to internal id.
96
-
97
-    args: [object_id], e.g. 'vol-0000000a' or 'volume-0000000a' or '10'
98
-    """
99
-    if uuidutils.is_uuid_like(object_id):
100
-        return object_id
101
-    elif '-' in object_id:
102
-        # FIXME(ja): mapping occurs in nova?
103
-        pass
104
-    else:
105
-        return int(object_id)
106
-
107
-
108 93
 class ShellCommands(object):
109 94
     def bpython(self):
110 95
         """Runs a bpython shell.

+ 0
- 16
manila/tests/cmd/test_manage.py View File

@@ -47,22 +47,6 @@ class ManilaCmdManageTestCase(test.TestCase):
47 47
         self.service_cmds = manila_manage.ServiceCommands()
48 48
         self.share_cmds = manila_manage.ShareCommands()
49 49
 
50
-    def test_param2id_is_uuid_like(self):
51
-        obj_id = '12345678123456781234567812345678'
52
-        self.assertEqual(obj_id, manila_manage.param2id(obj_id))
53
-
54
-    def test_param2id_not_uuid_like_with_dash(self):
55
-        obj_id = '112-112-112'
56
-        self.assertIsNone(manila_manage.param2id(obj_id))
57
-
58
-    def test_param2id_not_uuid_like_without_dash(self):
59
-        obj_id = '123'
60
-        self.assertEqual(123, manila_manage.param2id(obj_id))
61
-
62
-    def test_param2id_not_uuid_like_value_error(self):
63
-        obj_id = 'invalidvalue'
64
-        self.assertRaises(ValueError, manila_manage.param2id, obj_id)
65
-
66 50
     @mock.patch.object(manila_manage.ShellCommands, 'run', mock.Mock())
67 51
     def test_shell_commands_bpython(self):
68 52
         self.shell_commands.bpython()

Loading…
Cancel
Save