Remove is_uuid() from HeatIdentifier class
We now use the equivalent functionality from openstack-common. Change-Id: I915cdb92b89d3548fa03e1820d8b90b2aac4e44b Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
c985e79960
commit
61303fb777
|
@ -26,12 +26,6 @@ class HeatIdentifier(collections.Mapping):
|
|||
)
|
||||
path_re = re.compile(r'stacks/([^/]+)/([^/]+)(.*)')
|
||||
|
||||
HEX_ELEM = '[0-9A-Fa-f]'
|
||||
UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}',
|
||||
HEX_ELEM + '{4}', HEX_ELEM + '{4}',
|
||||
HEX_ELEM + '{12}'])
|
||||
uuid_re = re.compile(r'^' + UUID_PATTERN + '$')
|
||||
|
||||
def __init__(self, tenant, stack_name, stack_id, path=''):
|
||||
'''
|
||||
Initialise a HeatIdentifier from a Tenant ID, Stack name, Stack ID
|
||||
|
@ -48,10 +42,6 @@ class HeatIdentifier(collections.Mapping):
|
|||
self.PATH: path,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def is_uuid(cls, uuid):
|
||||
return HeatIdentifier.uuid_re.match(uuid)
|
||||
|
||||
@classmethod
|
||||
def from_arn(cls, arn):
|
||||
'''
|
||||
|
|
|
@ -20,7 +20,6 @@ import mox
|
|||
import json
|
||||
|
||||
from heat.engine import identifier
|
||||
from heat.common import utils
|
||||
|
||||
|
||||
@attr(tag=['unit', 'identifier'])
|
||||
|
@ -226,17 +225,6 @@ class IdentifierTest(unittest.TestCase):
|
|||
hi = identifier.HeatIdentifier('t', 's', 'i', 'p1/p2/p3')
|
||||
self.assertEqual(hi._path_components(), ['p1', 'p2', 'p3'])
|
||||
|
||||
def test_uuid_match(self):
|
||||
uuid = utils.generate_uuid()
|
||||
self.assertTrue(identifier.HeatIdentifier.is_uuid(uuid))
|
||||
self.assertFalse(identifier.HeatIdentifier.is_uuid('a' + uuid))
|
||||
self.assertFalse(identifier.HeatIdentifier.is_uuid(
|
||||
'zzzzzzzz-zzzz-zzzz-zzzzzzzzzzzz'))
|
||||
self.assertFalse(identifier.HeatIdentifier.is_uuid(uuid + 'a'))
|
||||
for i in xrange(100):
|
||||
self.assertTrue(identifier.HeatIdentifier.is_uuid(
|
||||
utils.generate_uuid()))
|
||||
|
||||
|
||||
@attr(tag=['unit', 'identifier'])
|
||||
@attr(speed='fast')
|
||||
|
|
Loading…
Reference in New Issue