Merge "Tests: Fix RBD invalid UUID warnings"

This commit is contained in:
Zuul 2018-02-02 02:02:04 +00:00 committed by Gerrit Code Review
commit af19d7401b
2 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_utils.uuidutils import is_uuid_like
from oslo_versionedobjects import fields
from cinder import objects
@ -102,6 +103,9 @@ def fake_db_volume_attachment(**updates):
def fake_volume_obj(context, **updates):
if updates.get('encryption_key_id'):
assert is_uuid_like(updates['encryption_key_id'])
expected_attrs = updates.pop('expected_attrs',
['metadata', 'admin_metadata'])
vol = objects.Volume._from_db_object(context, objects.Volume(),

View File

@ -197,7 +197,7 @@ class RBDTestCase(test.TestCase):
**{'name': u'volume-0000000a',
'id': '55555555-222f-4b32-b585-9991b3bf0a99',
'size': 12,
'encryption_key_id': 'set_in_test'})
'encryption_key_id': fake.ENCRYPTION_KEY_ID})
self.snapshot = fake_snapshot.fake_snapshot_obj(
self.context, name='snapshot-0000000a')