Merge "Data source driver preserves data types"
This commit is contained in:
commit
d6ea3cb42b
|
@ -17,6 +17,7 @@ from __future__ import print_function
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import collections
|
||||||
import datetime
|
import datetime
|
||||||
from functools import cmp_to_key
|
from functools import cmp_to_key
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
@ -635,7 +636,7 @@ class DataSourceDriver(data_service.DataService):
|
||||||
|
|
||||||
for tup in table_state:
|
for tup in table_state:
|
||||||
d = {}
|
d = {}
|
||||||
d['data'] = tup
|
d['data'] = utils.tuple_to_congress(tup)
|
||||||
results.append(d)
|
results.append(d)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
@ -748,7 +749,13 @@ class DataSourceDriver(data_service.DataService):
|
||||||
# Reads a VALUE object and returns (result_rows, h)
|
# Reads a VALUE object and returns (result_rows, h)
|
||||||
if extract_fn is None:
|
if extract_fn is None:
|
||||||
extract_fn = lambda x: x
|
extract_fn = lambda x: x
|
||||||
return utils.value_to_congress(extract_fn(obj))
|
value = extract_fn(obj)
|
||||||
|
|
||||||
|
# preserve type if possible; convert to str if not Hashable
|
||||||
|
if isinstance(value, collections.Hashable):
|
||||||
|
return value
|
||||||
|
else:
|
||||||
|
return str(value)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _compare_subtranslator(cls, x, y):
|
def _compare_subtranslator(cls, x, y):
|
||||||
|
@ -837,8 +844,7 @@ class DataSourceDriver(data_service.DataService):
|
||||||
|
|
||||||
if subtrans[cls.TRANSLATION_TYPE] == cls.VALUE:
|
if subtrans[cls.TRANSLATION_TYPE] == cls.VALUE:
|
||||||
extract_fn = subtrans.get(cls.EXTRACT_FN, None)
|
extract_fn = subtrans.get(cls.EXTRACT_FN, None)
|
||||||
converted_items = tuple([(utils.value_to_congress(k),
|
converted_items = tuple([(k, cls._extract_value(v, extract_fn))
|
||||||
cls._extract_value(v, extract_fn))
|
|
||||||
for k, v in obj.items()])
|
for k, v in obj.items()])
|
||||||
if id_col:
|
if id_col:
|
||||||
h = cls._compute_id(id_col, obj, converted_items)
|
h = cls._compute_id(id_col, obj, converted_items)
|
||||||
|
@ -969,7 +975,7 @@ class DataSourceDriver(data_service.DataService):
|
||||||
col = fieldtranslator.get(cls.COL,
|
col = fieldtranslator.get(cls.COL,
|
||||||
fieldtranslator[cls.FIELDNAME])
|
fieldtranslator[cls.FIELDNAME])
|
||||||
if col in hdict_row:
|
if col in hdict_row:
|
||||||
new_row.append(utils.value_to_congress(hdict_row[col]))
|
new_row.append(hdict_row[col])
|
||||||
|
|
||||||
if id_col:
|
if id_col:
|
||||||
h = cls._compute_id(id_col, obj, new_row)
|
h = cls._compute_id(id_col, obj, new_row)
|
||||||
|
|
|
@ -28,7 +28,6 @@ import six
|
||||||
from congress.datasources import datasource_driver
|
from congress.datasources import datasource_driver
|
||||||
from congress.datasources import datasource_utils
|
from congress.datasources import datasource_utils
|
||||||
from congress.datasources import murano_classes
|
from congress.datasources import murano_classes
|
||||||
from congress import utils
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -341,10 +340,10 @@ class MuranoDriver(datasource_driver.PollingDataSourceDriver,
|
||||||
return
|
return
|
||||||
for item in value:
|
for item in value:
|
||||||
self.state[self.PROPERTIES].add(
|
self.state[self.PROPERTIES].add(
|
||||||
(obj_id, key, utils.value_to_congress(item)))
|
(obj_id, key, item))
|
||||||
else:
|
else:
|
||||||
self.state[self.PROPERTIES].add(
|
self.state[self.PROPERTIES].add(
|
||||||
(obj_id, key, utils.value_to_congress(value)))
|
(obj_id, key, value))
|
||||||
|
|
||||||
def _add_relationships(self, obj_id, key, value):
|
def _add_relationships(self, obj_id, key, value):
|
||||||
"""Add a set of (obj_id, value, key) to relationships table.
|
"""Add a set of (obj_id, value, key) to relationships table.
|
||||||
|
|
|
@ -2142,11 +2142,13 @@ class DseRuntime (Runtime, data_service.DataService):
|
||||||
to_del = data[1]
|
to_del = data[1]
|
||||||
result = []
|
result = []
|
||||||
for row in to_del:
|
for row in to_del:
|
||||||
formula = compile.Literal.create_from_table_tuple(table, row)
|
formula = compile.Literal.create_from_table_tuple(
|
||||||
|
table, utils.tuple_to_congress(row))
|
||||||
event = compile.Event(formula=formula, insert=False)
|
event = compile.Event(formula=formula, insert=False)
|
||||||
result.append(event)
|
result.append(event)
|
||||||
for row in to_add:
|
for row in to_add:
|
||||||
formula = compile.Literal.create_from_table_tuple(table, row)
|
formula = compile.Literal.create_from_table_tuple(
|
||||||
|
table, utils.tuple_to_congress(row))
|
||||||
event = compile.Event(formula=formula, insert=True)
|
event = compile.Event(formula=formula, insert=True)
|
||||||
result.append(event)
|
result.append(event)
|
||||||
self.receive_data_update(publisher, table, result)
|
self.receive_data_update(publisher, table, result)
|
||||||
|
@ -2168,7 +2170,8 @@ class DseRuntime (Runtime, data_service.DataService):
|
||||||
LOG.debug("received full data msg for %s:%s. %s",
|
LOG.debug("received full data msg for %s:%s. %s",
|
||||||
publisher, table, utility.iterstr(data))
|
publisher, table, utility.iterstr(data))
|
||||||
# Use a generator to avoid instantiating all these Facts at once.
|
# Use a generator to avoid instantiating all these Facts at once.
|
||||||
facts = (compile.Fact(table, row) for row in data)
|
facts = (compile.Fact(table, utils.tuple_to_congress(row))
|
||||||
|
for row in data)
|
||||||
self.initialize_tables([table], facts, target=publisher)
|
self.initialize_tables([table], facts, target=publisher)
|
||||||
|
|
||||||
def receive_data_update(self, publisher, table, data):
|
def receive_data_update(self, publisher, table, data):
|
||||||
|
|
|
@ -82,7 +82,7 @@ class TestCinderDriver(base.TestCase):
|
||||||
'name': 'alice',
|
'name': 'alice',
|
||||||
'bootable': 'true',
|
'bootable': 'true',
|
||||||
'created_at': '2014-10-12T06:54:55.000000',
|
'created_at': '2014-10-12T06:54:55.000000',
|
||||||
'volume_type': 'None',
|
'volume_type': None,
|
||||||
'encrypted': True,
|
'encrypted': True,
|
||||||
'availability_zone': 'nova2',
|
'availability_zone': 'nova2',
|
||||||
'replication_status': 'r_status2',
|
'replication_status': 'r_status2',
|
||||||
|
@ -103,16 +103,16 @@ class TestCinderDriver(base.TestCase):
|
||||||
self.assertEqual({('8bf2eddb-0e1a-46f9-a49a-853f8016f476', '1',
|
self.assertEqual({('8bf2eddb-0e1a-46f9-a49a-853f8016f476', '1',
|
||||||
'b75055d5f0834d99ae874f085cf95272', 'available',
|
'b75055d5f0834d99ae874f085cf95272', 'available',
|
||||||
'foo', 'bar', 'false', '2014-10-09T12:16:23.000000',
|
'foo', 'bar', 'false', '2014-10-09T12:16:23.000000',
|
||||||
'lvmdriver-1', 'False', 'nova1', 'r_status1',
|
'lvmdriver-1', False, 'nova1', 'r_status1',
|
||||||
'True', '3b890e8a-7881-4430-b087-9e9e642e5e0d',
|
True, '3b890e8a-7881-4430-b087-9e9e642e5e0d',
|
||||||
'b4c36f7a-ac1b-41a6-9e83-03a6c1149669',
|
'b4c36f7a-ac1b-41a6-9e83-03a6c1149669',
|
||||||
'7aa9787f-285d-4d22-8211-e20af07f1044',
|
'7aa9787f-285d-4d22-8211-e20af07f1044',
|
||||||
'm_status1'),
|
'm_status1'),
|
||||||
('7cd8f73d-3243-49c9-a25b-a77ceb6ad1fa', '1',
|
('7cd8f73d-3243-49c9-a25b-a77ceb6ad1fa', '1',
|
||||||
'6e14edb203a84aa6a5a6a90872cbae79', 'creating',
|
'6e14edb203a84aa6a5a6a90872cbae79', 'creating',
|
||||||
'wonder', 'alice', 'true',
|
'wonder', 'alice', 'true',
|
||||||
'2014-10-12T06:54:55.000000', 'None',
|
'2014-10-12T06:54:55.000000', None,
|
||||||
'True', 'nova2', 'r_status2', 'False',
|
True, 'nova2', 'r_status2', False,
|
||||||
'658b5663-9e83-406b-8b81-4a50cafaa2d6',
|
'658b5663-9e83-406b-8b81-4a50cafaa2d6',
|
||||||
'bf789ec1-b4a2-4ea0-94f4-4a6ebcc00ad8',
|
'bf789ec1-b4a2-4ea0-94f4-4a6ebcc00ad8',
|
||||||
'960ec54c-c2a4-4e4c-8192-8b1d9eb65fae',
|
'960ec54c-c2a4-4e4c-8192-8b1d9eb65fae',
|
||||||
|
@ -122,12 +122,12 @@ class TestCinderDriver(base.TestCase):
|
||||||
self.assertEqual({('8bf2eddb-0e1a-46f9-a49a-853f8016f476',
|
self.assertEqual({('8bf2eddb-0e1a-46f9-a49a-853f8016f476',
|
||||||
'a4fda93b-06e0-4743-8117-bc8bcecd651b',
|
'a4fda93b-06e0-4743-8117-bc8bcecd651b',
|
||||||
'ab4db356-253d-4fab-bfa0-e3626c0b8405',
|
'ab4db356-253d-4fab-bfa0-e3626c0b8405',
|
||||||
'None',
|
None,
|
||||||
'/dev/vda'),
|
'/dev/vda'),
|
||||||
('8bf2eddb-0e1a-46f9-a49a-853f8016f476',
|
('8bf2eddb-0e1a-46f9-a49a-853f8016f476',
|
||||||
'b4fda93b-06e0-4743-8117-bc8bcecd651b',
|
'b4fda93b-06e0-4743-8117-bc8bcecd651b',
|
||||||
'bb4db356-253d-4fab-bfa0-e3626c0b8405',
|
'bb4db356-253d-4fab-bfa0-e3626c0b8405',
|
||||||
'None',
|
None,
|
||||||
'/dev/vdb')},
|
'/dev/vdb')},
|
||||||
self.driver.state['attachments'])
|
self.driver.state['attachments'])
|
||||||
|
|
||||||
|
@ -166,14 +166,14 @@ class TestCinderDriver(base.TestCase):
|
||||||
'state': 'up',
|
'state': 'up',
|
||||||
'updated_at': '2014-10-10T06:25:08.000000',
|
'updated_at': '2014-10-10T06:25:08.000000',
|
||||||
'host': 'openstack@lvmdriver-1',
|
'host': 'openstack@lvmdriver-1',
|
||||||
'disabled_reason': 'None'}),
|
'disabled_reason': None}),
|
||||||
ResponseObj({'status': 'enabled',
|
ResponseObj({'status': 'enabled',
|
||||||
'binary': 'cinder-scheduler',
|
'binary': 'cinder-scheduler',
|
||||||
'zone': 'nova',
|
'zone': 'nova',
|
||||||
'state': 'up',
|
'state': 'up',
|
||||||
'updated_at': '2014-10-10T06:25:08.000000',
|
'updated_at': '2014-10-10T06:25:08.000000',
|
||||||
'host': 'openstack',
|
'host': 'openstack',
|
||||||
'disabled_reason': 'None'})]
|
'disabled_reason': None})]
|
||||||
|
|
||||||
service_list = self.driver._translate_services(services_data)
|
service_list = self.driver._translate_services(services_data)
|
||||||
self.assertIsNotNone(service_list)
|
self.assertIsNotNone(service_list)
|
||||||
|
@ -181,10 +181,10 @@ class TestCinderDriver(base.TestCase):
|
||||||
|
|
||||||
self.assertEqual({('enabled', 'cinder-scheduler', 'nova',
|
self.assertEqual({('enabled', 'cinder-scheduler', 'nova',
|
||||||
'up', '2014-10-10T06:25:08.000000',
|
'up', '2014-10-10T06:25:08.000000',
|
||||||
'openstack@lvmdriver-1', 'None'),
|
'openstack@lvmdriver-1', None),
|
||||||
('enabled', 'cinder-scheduler', 'nova',
|
('enabled', 'cinder-scheduler', 'nova',
|
||||||
'up', '2014-10-10T06:25:08.000000',
|
'up', '2014-10-10T06:25:08.000000',
|
||||||
'openstack', 'None')},
|
'openstack', None)},
|
||||||
self.driver.state['services'])
|
self.driver.state['services'])
|
||||||
|
|
||||||
def test_execute(self):
|
def test_execute(self):
|
||||||
|
|
|
@ -289,7 +289,7 @@ EXPECTED_STATE = {
|
||||||
'services': set([
|
'services': set([
|
||||||
('88f61682-d78e-410f-88ee-1e0eabbbc7da',
|
('88f61682-d78e-410f-88ee-1e0eabbbc7da',
|
||||||
'8da5477d-340e-4bb4-808a-54d9f72017d1', 'rails-postgres',
|
'8da5477d-340e-4bb4-808a-54d9f72017d1', 'rails-postgres',
|
||||||
0, 'None', 'turtle')]),
|
0, None, 'turtle')]),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -520,14 +520,14 @@ class TestDatasourceDriver(base.TestCase):
|
||||||
rows, k = datasource_driver.DataSourceDriver.convert_obj(resp,
|
rows, k = datasource_driver.DataSourceDriver.convert_obj(resp,
|
||||||
translator)
|
translator)
|
||||||
|
|
||||||
k1 = self.compute_hash((1, 'a', 'b', 'True'))
|
k1 = self.compute_hash((1, 'a', 'b', True))
|
||||||
|
|
||||||
self.assertEqual(4, len(rows))
|
self.assertEqual(4, len(rows))
|
||||||
self.assertEqual(k1, k)
|
self.assertEqual(k1, k)
|
||||||
self.assertIn(('testtable', (k, 1)), rows)
|
self.assertIn(('testtable', (k, 1)), rows)
|
||||||
self.assertIn(('testtable', (k, 'a')), rows)
|
self.assertIn(('testtable', (k, 'a')), rows)
|
||||||
self.assertIn(('testtable', (k, 'b')), rows)
|
self.assertIn(('testtable', (k, 'b')), rows)
|
||||||
self.assertIn(('testtable', (k, 'True')), rows)
|
self.assertIn(('testtable', (k, True)), rows)
|
||||||
|
|
||||||
def test_convert_list_with_id_function(self):
|
def test_convert_list_with_id_function(self):
|
||||||
# Test a single LIST with an id function
|
# Test a single LIST with an id function
|
||||||
|
@ -545,7 +545,7 @@ class TestDatasourceDriver(base.TestCase):
|
||||||
self.assertIn(('testtable', (k, 1)), rows)
|
self.assertIn(('testtable', (k, 1)), rows)
|
||||||
self.assertIn(('testtable', (k, 'a')), rows)
|
self.assertIn(('testtable', (k, 'a')), rows)
|
||||||
self.assertIn(('testtable', (k, 'b')), rows)
|
self.assertIn(('testtable', (k, 'b')), rows)
|
||||||
self.assertIn(('testtable', (k, 'True')), rows)
|
self.assertIn(('testtable', (k, True)), rows)
|
||||||
|
|
||||||
def test_convert_list_without_id(self):
|
def test_convert_list_without_id(self):
|
||||||
# Test a single LIST without an id_column
|
# Test a single LIST without an id_column
|
||||||
|
@ -560,7 +560,7 @@ class TestDatasourceDriver(base.TestCase):
|
||||||
self.assertIn(('testtable', (1,)), rows)
|
self.assertIn(('testtable', (1,)), rows)
|
||||||
self.assertIn(('testtable', ('a',)), rows)
|
self.assertIn(('testtable', ('a',)), rows)
|
||||||
self.assertIn(('testtable', ('b',)), rows)
|
self.assertIn(('testtable', ('b',)), rows)
|
||||||
self.assertIn(('testtable', ('True',)), rows)
|
self.assertIn(('testtable', (True,)), rows)
|
||||||
|
|
||||||
def test_convert_list_with_sublist(self):
|
def test_convert_list_with_sublist(self):
|
||||||
# Test a single LIST with an id_column
|
# Test a single LIST with an id_column
|
||||||
|
@ -576,7 +576,7 @@ class TestDatasourceDriver(base.TestCase):
|
||||||
|
|
||||||
k1 = self.compute_hash((1, 2, 3))
|
k1 = self.compute_hash((1, 2, 3))
|
||||||
k2 = self.compute_hash(('a', 'b', 'c'))
|
k2 = self.compute_hash(('a', 'b', 'c'))
|
||||||
k3 = self.compute_hash(('True', 'False'))
|
k3 = self.compute_hash((True, False))
|
||||||
k = self.compute_hash((k1, k2, k3))
|
k = self.compute_hash((k1, k2, k3))
|
||||||
|
|
||||||
self.assertEqual(11, len(rows))
|
self.assertEqual(11, len(rows))
|
||||||
|
@ -587,8 +587,8 @@ class TestDatasourceDriver(base.TestCase):
|
||||||
self.assertIn(('subtable', (k2, 'a')), rows)
|
self.assertIn(('subtable', (k2, 'a')), rows)
|
||||||
self.assertIn(('subtable', (k2, 'b')), rows)
|
self.assertIn(('subtable', (k2, 'b')), rows)
|
||||||
self.assertIn(('subtable', (k2, 'c')), rows)
|
self.assertIn(('subtable', (k2, 'c')), rows)
|
||||||
self.assertIn(('subtable', (k3, 'True')), rows)
|
self.assertIn(('subtable', (k3, True)), rows)
|
||||||
self.assertIn(('subtable', (k3, 'False')), rows)
|
self.assertIn(('subtable', (k3, False)), rows)
|
||||||
self.assertIn(('testtable', (k, k1)), rows)
|
self.assertIn(('testtable', (k, k1)), rows)
|
||||||
self.assertIn(('testtable', (k, k2)), rows)
|
self.assertIn(('testtable', (k, k2)), rows)
|
||||||
self.assertIn(('testtable', (k, k3)), rows)
|
self.assertIn(('testtable', (k, k3)), rows)
|
||||||
|
@ -627,7 +627,7 @@ class TestDatasourceDriver(base.TestCase):
|
||||||
|
|
||||||
self.assertEqual(1, len(rows))
|
self.assertEqual(1, len(rows))
|
||||||
self.assertIsNone(k)
|
self.assertIsNone(k)
|
||||||
self.assertEqual([('testtable', ('FOO', 'None'))], rows)
|
self.assertEqual([('testtable', ('FOO', None))], rows)
|
||||||
|
|
||||||
def test_convert_recursive_hdict_single_fields_default_col(self):
|
def test_convert_recursive_hdict_single_fields_default_col(self):
|
||||||
# Test simple fields inside of an HDICT using the default col name.
|
# Test simple fields inside of an HDICT using the default col name.
|
||||||
|
|
|
@ -90,7 +90,7 @@ class TestGlanceV2Driver(base.TestCase):
|
||||||
u'2014-10-01T20:28:07Z',
|
u'2014-10-01T20:28:07Z',
|
||||||
u'ami',
|
u'ami',
|
||||||
u'4dfdcf14a20940799d89c7a5e7345978',
|
u'4dfdcf14a20940799d89c7a5e7345978',
|
||||||
'False',
|
False,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
u'4eada48c2843d2a262c814ddc92ecf2c',
|
u'4eada48c2843d2a262c814ddc92ecf2c',
|
||||||
|
@ -108,14 +108,14 @@ class TestGlanceV2Driver(base.TestCase):
|
||||||
u'2014-10-01T20:28:09Z',
|
u'2014-10-01T20:28:09Z',
|
||||||
u'qcow2',
|
u'qcow2',
|
||||||
u'4dfdcf14a20940799d89c7a5e7345978',
|
u'4dfdcf14a20940799d89c7a5e7345978',
|
||||||
'False',
|
False,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
u'9e486c3bf76219a6a37add392e425b36',
|
u'9e486c3bf76219a6a37add392e425b36',
|
||||||
209649664,
|
209649664,
|
||||||
u'/v2/images/c42736e7-8b09-4906-abd2-d6dc8673c297/file',
|
u'/v2/images/c42736e7-8b09-4906-abd2-d6dc8673c297/file',
|
||||||
'None',
|
None,
|
||||||
'None',
|
None,
|
||||||
u'/v2/schemas/image',
|
u'/v2/schemas/image',
|
||||||
u'public')]),
|
u'public')]),
|
||||||
'tags': set([
|
'tags': set([
|
||||||
|
|
|
@ -107,7 +107,7 @@ class TestIronicDriver(base.TestCase):
|
||||||
'512', 'x86_64', '10', '1')]),
|
'512', 'x86_64', '10', '1')]),
|
||||||
'chassises': set([
|
'chassises': set([
|
||||||
('89a15e07-5c80-48a4-b440-9c61ddb7e652',
|
('89a15e07-5c80-48a4-b440-9c61ddb7e652',
|
||||||
'2015-01-13T06:52:01+00:00', 'None')]),
|
'2015-01-13T06:52:01+00:00', None)]),
|
||||||
'active_hosts': set([
|
'active_hosts': set([
|
||||||
('pxe_ipmitool', 'localhost'),
|
('pxe_ipmitool', 'localhost'),
|
||||||
('pxe_ssh', 'localhost'),
|
('pxe_ssh', 'localhost'),
|
||||||
|
@ -116,7 +116,7 @@ class TestIronicDriver(base.TestCase):
|
||||||
('9cf035f0-351c-43d5-8968-f9fe2c41787b',
|
('9cf035f0-351c-43d5-8968-f9fe2c41787b',
|
||||||
'89a15e07-5c80-48a4-b440-9c61ddb7e652',
|
'89a15e07-5c80-48a4-b440-9c61ddb7e652',
|
||||||
'power on',
|
'power on',
|
||||||
'False',
|
False,
|
||||||
'pxe_ssh',
|
'pxe_ssh',
|
||||||
'2520745f-b4da-4e10-9d32-84451cfa8b33',
|
'2520745f-b4da-4e10-9d32-84451cfa8b33',
|
||||||
'2015-01-13T06:52:02+00:00',
|
'2015-01-13T06:52:02+00:00',
|
||||||
|
@ -125,17 +125,17 @@ class TestIronicDriver(base.TestCase):
|
||||||
('7a95ebf5-f213-4427-b669-010438f43e87',
|
('7a95ebf5-f213-4427-b669-010438f43e87',
|
||||||
'89a15e07-5c80-48a4-b440-9c61ddb7e652',
|
'89a15e07-5c80-48a4-b440-9c61ddb7e652',
|
||||||
'power off',
|
'power off',
|
||||||
'False',
|
False,
|
||||||
'pxe_ssh',
|
'pxe_ssh',
|
||||||
'None',
|
None,
|
||||||
'2015-01-13T06:52:04+00:00',
|
'2015-01-13T06:52:04+00:00',
|
||||||
'None',
|
None,
|
||||||
'2015-02-10T07:55:24+00:00')]),
|
'2015-02-10T07:55:24+00:00')]),
|
||||||
'ports': set([
|
'ports': set([
|
||||||
('49f3205a-db1e-4497-9371-6011ef572981',
|
('49f3205a-db1e-4497-9371-6011ef572981',
|
||||||
'7a95ebf5-f213-4427-b669-010438f43e87',
|
'7a95ebf5-f213-4427-b669-010438f43e87',
|
||||||
'52:54:00:98:f2:4e', '',
|
'52:54:00:98:f2:4e', '',
|
||||||
'2015-01-13T06:52:05+00:00', 'None'),
|
'2015-01-13T06:52:05+00:00', None),
|
||||||
('43190aae-d5fe-444f-9d50-155fca4bad82',
|
('43190aae-d5fe-444f-9d50-155fca4bad82',
|
||||||
'9cf035f0-351c-43d5-8968-f9fe2c41787b',
|
'9cf035f0-351c-43d5-8968-f9fe2c41787b',
|
||||||
'52:54:00:7f:e7:2e',
|
'52:54:00:7f:e7:2e',
|
||||||
|
|
|
@ -86,11 +86,11 @@ class TestKeystoneDriver(base.TestCase):
|
||||||
self.assertEqual(2, len(user_list))
|
self.assertEqual(2, len(user_list))
|
||||||
|
|
||||||
# Check an individual user entry
|
# Check an individual user entry
|
||||||
self.assertIn(('alice', 'alice foo', 'True',
|
self.assertIn(('alice', 'alice foo', True,
|
||||||
'019b18a15f2a44c1880d57704b2c4009',
|
'019b18a15f2a44c1880d57704b2c4009',
|
||||||
'00f2c34a156c40058004ee8eb3320e04',
|
'00f2c34a156c40058004ee8eb3320e04',
|
||||||
'alice@foo.com'), user_list)
|
'alice@foo.com'), user_list)
|
||||||
self.assertIn(('bob', 'bob bar', 'False',
|
self.assertIn(('bob', 'bob bar', False,
|
||||||
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||||
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
|
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
|
||||||
'bob@bar.edu'), user_list)
|
'bob@bar.edu'), user_list)
|
||||||
|
@ -117,10 +117,10 @@ class TestKeystoneDriver(base.TestCase):
|
||||||
self.assertEqual(2, len(tenants_list))
|
self.assertEqual(2, len(tenants_list))
|
||||||
|
|
||||||
# Check an individual role entry
|
# Check an individual role entry
|
||||||
self.assertIn(('True', 'accounting team', 'accounting',
|
self.assertIn((True, 'accounting team', 'accounting',
|
||||||
'00000000000000000000000000000001'),
|
'00000000000000000000000000000001'),
|
||||||
tenants_list)
|
tenants_list)
|
||||||
self.assertIn(('False', 'eng team', 'eng',
|
self.assertIn((False, 'eng team', 'eng',
|
||||||
'00000000000000000000000000000002'),
|
'00000000000000000000000000000002'),
|
||||||
tenants_list)
|
tenants_list)
|
||||||
|
|
||||||
|
|
|
@ -102,10 +102,10 @@ class TestKeystoneDriver(base.TestCase):
|
||||||
|
|
||||||
# Check an individual user entry
|
# Check an individual user entry
|
||||||
self.assertIn(('00f2c34a156c40058004ee8eb3320e04',
|
self.assertIn(('00f2c34a156c40058004ee8eb3320e04',
|
||||||
'alice', 'True', '019b18a15f2a44c1880d57704b2c4009',
|
'alice', True, '019b18a15f2a44c1880d57704b2c4009',
|
||||||
'default'), user_list)
|
'default'), user_list)
|
||||||
self.assertIn(('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
|
self.assertIn(('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
|
||||||
'bob', 'False', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
'bob', False, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||||
'default'), user_list)
|
'default'), user_list)
|
||||||
|
|
||||||
def test_list_roles(self):
|
def test_list_roles(self):
|
||||||
|
@ -130,9 +130,9 @@ class TestKeystoneDriver(base.TestCase):
|
||||||
self.assertEqual(2, len(domains_list))
|
self.assertEqual(2, len(domains_list))
|
||||||
|
|
||||||
# Check an individual role entry
|
# Check an individual role entry
|
||||||
self.assertIn(('False', 'domain 2', 'test domain',
|
self.assertIn((False, 'domain 2', 'test domain',
|
||||||
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), domains_list)
|
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), domains_list)
|
||||||
self.assertIn(('True', 'domain 1', 'default',
|
self.assertIn((True, 'domain 1', 'default',
|
||||||
'1fbe4e6fedb34050ad56c6e5dd225998'), domains_list)
|
'1fbe4e6fedb34050ad56c6e5dd225998'), domains_list)
|
||||||
|
|
||||||
def test_list_projects(self):
|
def test_list_projects(self):
|
||||||
|
@ -144,9 +144,9 @@ class TestKeystoneDriver(base.TestCase):
|
||||||
self.assertEqual(2, len(projects_list))
|
self.assertEqual(2, len(projects_list))
|
||||||
|
|
||||||
# Check an individual role entry
|
# Check an individual role entry
|
||||||
self.assertIn(('True', 'accounting team', 'accounting', 'default',
|
self.assertIn((True, 'accounting team', 'accounting', 'default',
|
||||||
'00000000000000000000000000000001'), projects_list)
|
'00000000000000000000000000000001'), projects_list)
|
||||||
self.assertIn(('False', 'eng team', 'eng', 'default',
|
self.assertIn((False, 'eng team', 'eng', 'default',
|
||||||
'00000000000000000000000000000002'), projects_list)
|
'00000000000000000000000000000002'), projects_list)
|
||||||
|
|
||||||
def test_execute(self):
|
def test_execute(self):
|
||||||
|
|
|
@ -83,9 +83,9 @@ class TestMistralDriver(base.TestCase):
|
||||||
u'',
|
u'',
|
||||||
u'<default-project>',
|
u'<default-project>',
|
||||||
u'2017-10-12 20:06:58',
|
u'2017-10-12 20:06:58',
|
||||||
u'None',
|
None,
|
||||||
u"---\nversion: '2.0'\n\nstd.create_instance:\n...",
|
u"---\nversion: '2.0'\n\nstd.create_instance:\n...",
|
||||||
u'None'),
|
None),
|
||||||
(u'std.delete_instance',
|
(u'std.delete_instance',
|
||||||
u'55f43e39-89aa-43e6-9eec-526b5aa932b9',
|
u'55f43e39-89aa-43e6-9eec-526b5aa932b9',
|
||||||
u'public',
|
u'public',
|
||||||
|
@ -93,9 +93,9 @@ class TestMistralDriver(base.TestCase):
|
||||||
u'',
|
u'',
|
||||||
u'<default-project>',
|
u'<default-project>',
|
||||||
u'2017-10-12 20:06:58',
|
u'2017-10-12 20:06:58',
|
||||||
u'None',
|
None,
|
||||||
u'---\nversion: "2.0"\n\nstd.delete_instance:\n...',
|
u'---\nversion: "2.0"\n\nstd.delete_instance:\n...',
|
||||||
u'None')},
|
None)},
|
||||||
self.driver.state['workflows'])
|
self.driver.state['workflows'])
|
||||||
|
|
||||||
def test_list_actions(self):
|
def test_list_actions(self):
|
||||||
|
@ -132,7 +132,7 @@ class TestMistralDriver(base.TestCase):
|
||||||
u'health_monitor, action_region="", body=null',
|
u'health_monitor, action_region="", body=null',
|
||||||
u'2017-10-13 20:06:56',
|
u'2017-10-13 20:06:56',
|
||||||
u'2017-10-13 23:06:56',
|
u'2017-10-13 23:06:56',
|
||||||
u'False',
|
False,
|
||||||
u'action definition',
|
u'action definition',
|
||||||
u'Updates a load balancer health monitor.',
|
u'Updates a load balancer health monitor.',
|
||||||
u'public'),
|
u'public'),
|
||||||
|
@ -140,9 +140,9 @@ class TestMistralDriver(base.TestCase):
|
||||||
u'neutron.update_health_monitor',
|
u'neutron.update_health_monitor',
|
||||||
u'health_monitor, action_region="", body=null',
|
u'health_monitor, action_region="", body=null',
|
||||||
u'2017-10-12 20:06:56',
|
u'2017-10-12 20:06:56',
|
||||||
u'None',
|
None,
|
||||||
u'True',
|
True,
|
||||||
u'None',
|
None,
|
||||||
u'Updates a load balancer health monitor.',
|
u'Updates a load balancer health monitor.',
|
||||||
u'public')},
|
u'public')},
|
||||||
self.driver.state['actions'])
|
self.driver.state['actions'])
|
||||||
|
@ -204,7 +204,7 @@ class TestMistralDriver(base.TestCase):
|
||||||
|
|
||||||
self.assertEqual({(u'5c377055-5590-479a-beec-3d4a47a2dfb6',
|
self.assertEqual({(u'5c377055-5590-479a-beec-3d4a47a2dfb6',
|
||||||
u'nova.servers_delete',
|
u'nova.servers_delete',
|
||||||
u'None',
|
None,
|
||||||
u'std.delete_instance',
|
u'std.delete_instance',
|
||||||
u'f40a0a20-958d-4948-b0c0-e1961649f2e2',
|
u'f40a0a20-958d-4948-b0c0-e1961649f2e2',
|
||||||
u'delete_vm',
|
u'delete_vm',
|
||||||
|
@ -212,7 +212,7 @@ class TestMistralDriver(base.TestCase):
|
||||||
u'{"server": 1}',
|
u'{"server": 1}',
|
||||||
u'2017-12-19 22:56:50',
|
u'2017-12-19 22:56:50',
|
||||||
u'2017-12-19 22:56:50',
|
u'2017-12-19 22:56:50',
|
||||||
u'True',
|
True,
|
||||||
u'ERROR',
|
u'ERROR',
|
||||||
u'')},
|
u'')},
|
||||||
self.driver.state['action_executions'])
|
self.driver.state['action_executions'])
|
||||||
|
|
|
@ -563,10 +563,10 @@ expected_service_properties = [
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'ipAddresses', '10.0.11.3'),
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'ipAddresses', '10.0.11.3'),
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'ipAddresses', '172.24.4.4'),
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'ipAddresses', '172.24.4.4'),
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e',
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e',
|
||||||
u'networks.useFlatNetwork', 'False'),
|
u'networks.useFlatNetwork', False),
|
||||||
(u'769af50c-9629-4694-b623-e9b392941279', u'name', 'MySqlDB'),
|
(u'769af50c-9629-4694-b623-e9b392941279', u'name', 'MySqlDB'),
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9',
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9',
|
||||||
u'networks.useEnvironmentNetwork', 'True'),
|
u'networks.useEnvironmentNetwork', True),
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9',
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9',
|
||||||
u'floatingIpAddress', '172.24.4.4'),
|
u'floatingIpAddress', '172.24.4.4'),
|
||||||
(u'fda74653-8b66-42e2-be16-12ebc87d7570', u'dbPassword', 'Passw0rd.'),
|
(u'fda74653-8b66-42e2-be16-12ebc87d7570', u'dbPassword', 'Passw0rd.'),
|
||||||
|
@ -585,15 +585,15 @@ expected_service_properties = [
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'ipAddresses', '10.0.11.4'),
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'ipAddresses', '10.0.11.4'),
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'name', 'woydqi7nn7ipc2'),
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'name', 'woydqi7nn7ipc2'),
|
||||||
(u'fda74653-8b66-42e2-be16-12ebc87d7570', u'name', 'PetClinic'),
|
(u'fda74653-8b66-42e2-be16-12ebc87d7570', u'name', 'PetClinic'),
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'assignFloatingIp', 'True'),
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'assignFloatingIp', True),
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'assignFloatingIp', 'True'),
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'assignFloatingIp', True),
|
||||||
(u'769af50c-9629-4694-b623-e9b392941279', u'password', 'Passw0rd.'),
|
(u'769af50c-9629-4694-b623-e9b392941279', u'password', 'Passw0rd.'),
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'flavor', 'm1.small'),
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9', u'flavor', 'm1.small'),
|
||||||
(u'fda74653-8b66-42e2-be16-12ebc87d7570', u'dbName', 'pet_db'),
|
(u'fda74653-8b66-42e2-be16-12ebc87d7570', u'dbName', 'pet_db'),
|
||||||
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9',
|
(u'c52dda24-38d6-4f2f-9184-abca0beaa6e9',
|
||||||
u'networks.useFlatNetwork', 'False'),
|
u'networks.useFlatNetwork', False),
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e',
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e',
|
||||||
u'networks.useEnvironmentNetwork', 'True'),
|
u'networks.useEnvironmentNetwork', True),
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'availabilityZone', 'nova'),
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e', u'availabilityZone', 'nova'),
|
||||||
(u'76b9ca88-c668-4e37-a830-5845adc10b0e',
|
(u'76b9ca88-c668-4e37-a830-5845adc10b0e',
|
||||||
u'floatingIpAddress', '172.24.4.4'),
|
u'floatingIpAddress', '172.24.4.4'),
|
||||||
|
@ -604,7 +604,7 @@ expected_service_properties = [
|
||||||
]
|
]
|
||||||
|
|
||||||
expected_package_properties = [
|
expected_package_properties = [
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'is_public', 'False'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'is_public', False),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'tags', 'connection'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'tags', 'connection'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'created', '2015-03-23T21:28:58'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'created', '2015-03-23T21:28:58'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'tags', 'SQL'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'tags', 'SQL'),
|
||||||
|
@ -617,7 +617,7 @@ expected_package_properties = [
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'created', '2015-03-24T18:26:32'),
|
(u'5add5a561da341c4875495c5887957a8', u'created', '2015-03-24T18:26:32'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'name', 'MySQL'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'name', 'MySQL'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'tags', 'Database'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'tags', 'Database'),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'enabled', 'True'),
|
(u'5add5a561da341c4875495c5887957a8', u'enabled', True),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'tags', 'Pages'),
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'tags', 'Pages'),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'tags', 'Database'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'tags', 'Database'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'type', 'Application'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'type', 'Application'),
|
||||||
|
@ -627,9 +627,9 @@ expected_package_properties = [
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'fully_qualified_name',
|
(u'5add5a561da341c4875495c5887957a8', u'fully_qualified_name',
|
||||||
'io.murano.databases'),
|
'io.murano.databases'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'author', 'Mirantis, Inc'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'author', 'Mirantis, Inc'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'is_public', 'False'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'is_public', False),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'tags', 'SQL'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'tags', 'SQL'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'enabled', 'True'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'enabled', True),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'updated', '2015-03-23T21:29:10'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'updated', '2015-03-23T21:29:10'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'fully_qualified_name',
|
(u'884b764c0ce6439d8566b3b2da967687', u'fully_qualified_name',
|
||||||
'io.murano.databases.MySql'),
|
'io.murano.databases.MySql'),
|
||||||
|
@ -638,31 +638,31 @@ expected_package_properties = [
|
||||||
'io.murano.databases.PostgreSql'),
|
'io.murano.databases.PostgreSql'),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'tags', 'Java'),
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'tags', 'Java'),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'tags', 'Postgre'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'tags', 'Postgre'),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'is_public', 'False'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'is_public', False),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'type', 'Application'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'type', 'Application'),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'name', 'PostgreSQL'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'name', 'PostgreSQL'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'tags', 'Linux'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'tags', 'Linux'),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'author', 'Mirantis, Inc'),
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'author', 'Mirantis, Inc'),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'is_public', 'False'),
|
(u'5add5a561da341c4875495c5887957a8', u'is_public', False),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'tags', 'SQL'),
|
(u'5add5a561da341c4875495c5887957a8', u'tags', 'SQL'),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'author', 'Mirantis, Inc'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'author', 'Mirantis, Inc'),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'class_definitions',
|
(u'5add5a561da341c4875495c5887957a8', u'class_definitions',
|
||||||
'io.murano.databases.SqlDatabase'),
|
'io.murano.databases.SqlDatabase'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'updated', '2015-03-23T21:26:56'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'updated', '2015-03-23T21:26:56'),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'tags', 'RDBMS'),
|
(u'5add5a561da341c4875495c5887957a8', u'tags', 'RDBMS'),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'enabled', 'True'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'enabled', True),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'updated', '2015-03-24T18:26:32'),
|
(u'5add5a561da341c4875495c5887957a8', u'updated', '2015-03-24T18:26:32'),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'class_definitions',
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'class_definitions',
|
||||||
'io.murano.apps.java.PetClinic'),
|
'io.murano.apps.java.PetClinic'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'enabled', 'True'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'enabled', True),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'class_definitions',
|
(u'a7d64980999948dc96401cdce5ae2141', u'class_definitions',
|
||||||
'io.murano.apps.apache.Tomcat'),
|
'io.murano.apps.apache.Tomcat'),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'created', '2015-03-24T18:25:24'),
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'created', '2015-03-24T18:25:24'),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'author', 'Mirantis, Inc'),
|
(u'5add5a561da341c4875495c5887957a8', u'author', 'Mirantis, Inc'),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'is_public', 'False'),
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'is_public', False),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'class_definitions',
|
(u'884b764c0ce6439d8566b3b2da967687', u'class_definitions',
|
||||||
'io.murano.databases.MySql'),
|
'io.murano.databases.MySql'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'is_public', 'False'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'is_public', False),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'tags', 'RDBMS'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'tags', 'RDBMS'),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'author', 'Mirantis, Inc'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'author', 'Mirantis, Inc'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'name', 'Git'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'name', 'Git'),
|
||||||
|
@ -673,13 +673,13 @@ expected_package_properties = [
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'class_definitions',
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'class_definitions',
|
||||||
'io.murano.databases.PostgreSql'),
|
'io.murano.databases.PostgreSql'),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'tags', 'Pages'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'tags', 'Pages'),
|
||||||
(u'4b9c6a24c2e64f928156e0c87324c394', u'enabled', 'True'),
|
(u'4b9c6a24c2e64f928156e0c87324c394', u'enabled', True),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'tags', 'Server'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'tags', 'Server'),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'updated', '2015-03-23T21:28:11'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'updated', '2015-03-23T21:28:11'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'updated', '2015-03-23T21:28:58'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'updated', '2015-03-23T21:28:58'),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'name', 'Apache Tomcat'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'name', 'Apache Tomcat'),
|
||||||
(u'884b764c0ce6439d8566b3b2da967687', u'author', 'Mirantis, Inc'),
|
(u'884b764c0ce6439d8566b3b2da967687', u'author', 'Mirantis, Inc'),
|
||||||
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'enabled', 'True'),
|
(u'9f7c9e2ed8f9462a8f9037032ab64755', u'enabled', True),
|
||||||
(u'a7d64980999948dc96401cdce5ae2141', u'created', '2015-03-23T21:28:11'),
|
(u'a7d64980999948dc96401cdce5ae2141', u'created', '2015-03-23T21:28:11'),
|
||||||
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'created', '2015-03-23T21:26:56'),
|
(u'3ff58cdfeb27487fb3127fb8fd45109c', u'created', '2015-03-23T21:26:56'),
|
||||||
(u'5add5a561da341c4875495c5887957a8', u'name', 'SQL Library'),
|
(u'5add5a561da341c4875495c5887957a8', u'name', 'SQL Library'),
|
||||||
|
|
|
@ -316,16 +316,16 @@ class TestNeutronV2Driver(base.TestCase):
|
||||||
('3c0eb3a3-4d16-4b1b-b327-44417182d0bb',
|
('3c0eb3a3-4d16-4b1b-b327-44417182d0bb',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'private-subnet',
|
'feee0a965cc34274917fb753623dd57d', 'private-subnet',
|
||||||
'63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d', 4, '10.0.0.0/24',
|
'63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d', 4, '10.0.0.0/24',
|
||||||
'10.0.0.1', 'True', 'None', 'None'),
|
'10.0.0.1', True, None, None),
|
||||||
('aa9ad4f7-baf0-4a41-85c3-1cc8a3066db6', '',
|
('aa9ad4f7-baf0-4a41-85c3-1cc8a3066db6', '',
|
||||||
'meta-f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
'meta-f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
||||||
'6743ff85-2cfd-48a7-9d3f-472cd418783e', 4,
|
'6743ff85-2cfd-48a7-9d3f-472cd418783e', 4,
|
||||||
'169.254.169.252/30',
|
'169.254.169.252/30',
|
||||||
'169.254.169.253', 'True', 'None', 'None'),
|
'169.254.169.253', True, None, None),
|
||||||
('10d20df9-e8ba-4756-ba30-d573ceb2e99a',
|
('10d20df9-e8ba-4756-ba30-d573ceb2e99a',
|
||||||
'feee0a965cc34274917fb753623dd57d', '',
|
'feee0a965cc34274917fb753623dd57d', '',
|
||||||
'ecdea1af-7197-43c8-b3b0-34d90f72a2a8', 4, '1.1.1.0/24',
|
'ecdea1af-7197-43c8-b3b0-34d90f72a2a8', 4, '1.1.1.0/24',
|
||||||
'1.1.1.1', 'True', 'None', 'None')]),
|
'1.1.1.1', True, None, None)]),
|
||||||
'floating_ips': set([
|
'floating_ips': set([
|
||||||
("2f245a7b-796b-4f26-9cf9-9e82d248fda7",
|
("2f245a7b-796b-4f26-9cf9-9e82d248fda7",
|
||||||
"d23abc8d-2991-4a55-ba98-2aaea84cc72f",
|
"d23abc8d-2991-4a55-ba98-2aaea84cc72f",
|
||||||
|
@ -333,68 +333,68 @@ class TestNeutronV2Driver(base.TestCase):
|
||||||
"376da547-b977-4cfe-9cba-275c80debf57", "10.0.0.3",
|
"376da547-b977-4cfe-9cba-275c80debf57", "10.0.0.3",
|
||||||
"172.24.4.228", "ce705c24-c1ef-408a-bda3-7bbd946164ab",
|
"172.24.4.228", "ce705c24-c1ef-408a-bda3-7bbd946164ab",
|
||||||
"ACTIVE"),
|
"ACTIVE"),
|
||||||
("61cea855-49cb-4846-997d-801b70c71bdd", 'None',
|
("61cea855-49cb-4846-997d-801b70c71bdd", None,
|
||||||
"4969c491a3c74ee4af974e6d800c62de",
|
"4969c491a3c74ee4af974e6d800c62de",
|
||||||
"376da547-b977-4cfe-9cba-275c80debf57", 'None',
|
"376da547-b977-4cfe-9cba-275c80debf57", None,
|
||||||
"172.24.4.227", 'None', "DOWN")]),
|
"172.24.4.227", None, "DOWN")]),
|
||||||
'routers':
|
'routers':
|
||||||
set([('f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
set([('f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'DOWN', 'True',
|
'feee0a965cc34274917fb753623dd57d', 'DOWN', True,
|
||||||
'myrouter', 'False')]),
|
'myrouter', False)]),
|
||||||
'dns_nameservers':
|
'dns_nameservers':
|
||||||
set([('3c0eb3a3-4d16-4b1b-b327-44417182d0bb', '8.8.8.8')]),
|
set([('3c0eb3a3-4d16-4b1b-b327-44417182d0bb', '8.8.8.8')]),
|
||||||
'security_group_rules':
|
'security_group_rules':
|
||||||
set([('e0239062-4243-4798-865f-7055f03786d6',
|
set([('e0239062-4243-4798-865f-7055f03786d6',
|
||||||
'e70cf243-3389-4f80-82dc-92a3ec1f2d2a',
|
'e70cf243-3389-4f80-82dc-92a3ec1f2d2a',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'None', 'egress',
|
'feee0a965cc34274917fb753623dd57d', None, 'egress',
|
||||||
'IPv4', 'None', 'None', 'None', 'None'),
|
'IPv4', None, None, None, None),
|
||||||
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
||||||
'ed7fd9f6-e390-448a-9f5f-8dd4659282f7', '', 'None',
|
'ed7fd9f6-e390-448a-9f5f-8dd4659282f7', '', None,
|
||||||
'egress', 'IPv6', 'None', 'None', 'None', 'None'),
|
'egress', 'IPv6', None, None, None, None),
|
||||||
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
||||||
'1d943e83-e4e6-472a-9655-f74eb22f3668', '', 'None',
|
'1d943e83-e4e6-472a-9655-f74eb22f3668', '', None,
|
||||||
'egress', 'IPv4', 'None', 'None', 'None', 'None'),
|
'egress', 'IPv4', None, None, None, None),
|
||||||
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
||||||
'30be5ee1-5b0a-4929-aca5-0c25f1c6b733', '',
|
'30be5ee1-5b0a-4929-aca5-0c25f1c6b733', '',
|
||||||
'a268fc32-1a59-4154-9a7c-f453ef92560c', 'ingress',
|
'a268fc32-1a59-4154-9a7c-f453ef92560c', 'ingress',
|
||||||
'IPv4', 'None', 'None', 'None', 'None'),
|
'IPv4', None, None, None, None),
|
||||||
('e0239062-4243-4798-865f-7055f03786d6',
|
('e0239062-4243-4798-865f-7055f03786d6',
|
||||||
'8a81fecc-ecc7-48ca-bccc-195799667e23',
|
'8a81fecc-ecc7-48ca-bccc-195799667e23',
|
||||||
'feee0a965cc34274917fb753623dd57d',
|
'feee0a965cc34274917fb753623dd57d',
|
||||||
'e0239062-4243-4798-865f-7055f03786d6', 'ingress',
|
'e0239062-4243-4798-865f-7055f03786d6', 'ingress',
|
||||||
'IPv6', 'None', 'None', 'None', 'None'),
|
'IPv6', None, None, None, None),
|
||||||
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
('a268fc32-1a59-4154-9a7c-f453ef92560c',
|
||||||
'639995b8-c3ac-44a3-a4f3-c74f9172ad54', '',
|
'639995b8-c3ac-44a3-a4f3-c74f9172ad54', '',
|
||||||
'a268fc32-1a59-4154-9a7c-f453ef92560c', 'ingress',
|
'a268fc32-1a59-4154-9a7c-f453ef92560c', 'ingress',
|
||||||
'IPv6', 'None', 'None', 'None', 'None'),
|
'IPv6', None, None, None, None),
|
||||||
('e0239062-4243-4798-865f-7055f03786d6',
|
('e0239062-4243-4798-865f-7055f03786d6',
|
||||||
'8f4d9e99-1fe8-4816-9f07-c4ecddea9427',
|
'8f4d9e99-1fe8-4816-9f07-c4ecddea9427',
|
||||||
'feee0a965cc34274917fb753623dd57d',
|
'feee0a965cc34274917fb753623dd57d',
|
||||||
'e0239062-4243-4798-865f-7055f03786d6',
|
'e0239062-4243-4798-865f-7055f03786d6',
|
||||||
'ingress', 'IPv4', 'None', 'None', 'None', 'None'),
|
'ingress', 'IPv4', None, None, None, None),
|
||||||
('e0239062-4243-4798-865f-7055f03786d6',
|
('e0239062-4243-4798-865f-7055f03786d6',
|
||||||
'eca1df0f-b222-4208-8f96-8a8024fd6834',
|
'eca1df0f-b222-4208-8f96-8a8024fd6834',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'None', 'egress',
|
'feee0a965cc34274917fb753623dd57d', None, 'egress',
|
||||||
'IPv6', 'None', 'None', 'None', 'None')]),
|
'IPv6', None, None, None, None)]),
|
||||||
'ports':
|
'ports':
|
||||||
set([('c58c3246-6c2e-490a-b4d9-3b8d5191b465',
|
set([('c58c3246-6c2e-490a-b4d9-3b8d5191b465',
|
||||||
'feee0a965cc34274917fb753623dd57d', '',
|
'feee0a965cc34274917fb753623dd57d', '',
|
||||||
'63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d',
|
'63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d',
|
||||||
'fa:16:3e:08:31:6e', 'True', 'DOWN',
|
'fa:16:3e:08:31:6e', True, 'DOWN',
|
||||||
'f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
'f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
||||||
'network:router_interface'),
|
'network:router_interface'),
|
||||||
('87f8933a-9582-48d8-ad16-9abf6e545002', '', '',
|
('87f8933a-9582-48d8-ad16-9abf6e545002', '', '',
|
||||||
'6743ff85-2cfd-48a7-9d3f-472cd418783e',
|
'6743ff85-2cfd-48a7-9d3f-472cd418783e',
|
||||||
'fa:16:3e:b7:78:e8', 'True', 'DOWN',
|
'fa:16:3e:b7:78:e8', True, 'DOWN',
|
||||||
'f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
'f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
||||||
'network:router_interface'),
|
'network:router_interface'),
|
||||||
('eb50003b-a081-4533-92aa-1cbd97f526a8',
|
('eb50003b-a081-4533-92aa-1cbd97f526a8',
|
||||||
'feee0a965cc34274917fb753623dd57d', '',
|
'feee0a965cc34274917fb753623dd57d', '',
|
||||||
'63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d',
|
'63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d',
|
||||||
'fa:16:3e:af:56:fa', 'True', 'DOWN', '', ''),
|
'fa:16:3e:af:56:fa', True, 'DOWN', '', ''),
|
||||||
('04627c85-3553-436c-a7c5-0a64f5b87bb9', '', '',
|
('04627c85-3553-436c-a7c5-0a64f5b87bb9', '', '',
|
||||||
'ecdea1af-7197-43c8-b3b0-34d90f72a2a8',
|
'ecdea1af-7197-43c8-b3b0-34d90f72a2a8',
|
||||||
'fa:16:3e:f3:19:e5', 'True', 'DOWN',
|
'fa:16:3e:f3:19:e5', True, 'DOWN',
|
||||||
'f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
'f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
||||||
'network:router_gateway')]),
|
'network:router_gateway')]),
|
||||||
'allocation_pools':
|
'allocation_pools':
|
||||||
|
@ -412,7 +412,7 @@ class TestNeutronV2Driver(base.TestCase):
|
||||||
'e0239062-4243-4798-865f-7055f03786d6')]),
|
'e0239062-4243-4798-865f-7055f03786d6')]),
|
||||||
'external_gateway_infos':
|
'external_gateway_infos':
|
||||||
set([('f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
set([('f42dc4f1-f371-48cc-95be-cf1b97112ab8',
|
||||||
'ecdea1af-7197-43c8-b3b0-34d90f72a2a8', 'True')]),
|
'ecdea1af-7197-43c8-b3b0-34d90f72a2a8', True)]),
|
||||||
'fixed_ips':
|
'fixed_ips':
|
||||||
set([('c58c3246-6c2e-490a-b4d9-3b8d5191b465', '10.0.0.1',
|
set([('c58c3246-6c2e-490a-b4d9-3b8d5191b465', '10.0.0.1',
|
||||||
'3c0eb3a3-4d16-4b1b-b327-44417182d0bb'),
|
'3c0eb3a3-4d16-4b1b-b327-44417182d0bb'),
|
||||||
|
@ -426,10 +426,10 @@ class TestNeutronV2Driver(base.TestCase):
|
||||||
'networks':
|
'networks':
|
||||||
set([('ecdea1af-7197-43c8-b3b0-34d90f72a2a8',
|
set([('ecdea1af-7197-43c8-b3b0-34d90f72a2a8',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'public',
|
'feee0a965cc34274917fb753623dd57d', 'public',
|
||||||
'ACTIVE', 'True', 'False'),
|
'ACTIVE', True, False),
|
||||||
('63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d',
|
('63ce8fbb-12e9-4ecd-9b56-1bbf8b51217d',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'private',
|
'feee0a965cc34274917fb753623dd57d', 'private',
|
||||||
'ACTIVE', 'True', 'False')]),
|
'ACTIVE', True, False)]),
|
||||||
'security_groups':
|
'security_groups':
|
||||||
set([('e0239062-4243-4798-865f-7055f03786d6',
|
set([('e0239062-4243-4798-865f-7055f03786d6',
|
||||||
'feee0a965cc34274917fb753623dd57d', 'default',
|
'feee0a965cc34274917fb753623dd57d', 'default',
|
||||||
|
|
|
@ -154,30 +154,30 @@ class TestNeutronV2QosDriver(base.TestCase):
|
||||||
'feee0a965cc34274917fb753623dd57d',
|
'feee0a965cc34274917fb753623dd57d',
|
||||||
'ysm',
|
'ysm',
|
||||||
'',
|
'',
|
||||||
'False')]),
|
False)]),
|
||||||
'rules':
|
'rules':
|
||||||
set([('be50b732-4508-4a94-9c3c-8dc4b96a2b43',
|
set([('be50b732-4508-4a94-9c3c-8dc4b96a2b43',
|
||||||
'015f3dc8-7d3e-4598-8996-0597328c4db5',
|
'015f3dc8-7d3e-4598-8996-0597328c4db5',
|
||||||
100,
|
100,
|
||||||
'egress',
|
'egress',
|
||||||
'minimum_bandwidth',
|
'minimum_bandwidth',
|
||||||
'None',
|
None,
|
||||||
'None',
|
None,
|
||||||
'None'),
|
None),
|
||||||
('be50b732-4508-4a94-9c3c-8dc4b96a2b43',
|
('be50b732-4508-4a94-9c3c-8dc4b96a2b43',
|
||||||
'6be91937-b9ec-4209-a430-0c2694df1095',
|
'6be91937-b9ec-4209-a430-0c2694df1095',
|
||||||
'None',
|
None,
|
||||||
'None',
|
None,
|
||||||
'dscp_marking',
|
'dscp_marking',
|
||||||
10,
|
10,
|
||||||
'None',
|
None,
|
||||||
'None'),
|
None),
|
||||||
('be50b732-4508-4a94-9c3c-8dc4b96a2b43',
|
('be50b732-4508-4a94-9c3c-8dc4b96a2b43',
|
||||||
'9daaa87a-5441-49ef-8f25-2810d37c3a60',
|
'9daaa87a-5441-49ef-8f25-2810d37c3a60',
|
||||||
'None',
|
None,
|
||||||
'egress',
|
'egress',
|
||||||
'bandwidth_limit',
|
'bandwidth_limit',
|
||||||
'None',
|
None,
|
||||||
500,
|
500,
|
||||||
100)])}
|
100)])}
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,8 @@ class TestNovaDriver(base.TestCase):
|
||||||
tenant_id)
|
tenant_id)
|
||||||
self.assertEqual('2', image_id)
|
self.assertEqual('2', image_id)
|
||||||
self.assertEqual('1', flavor_id)
|
self.assertEqual('1', flavor_id)
|
||||||
self.assertEqual('None', zone)
|
self.assertEqual(None, zone)
|
||||||
self.assertEqual('None', host_name)
|
self.assertEqual(None, host_name)
|
||||||
|
|
||||||
elif id == '9012':
|
elif id == '9012':
|
||||||
self.assertEqual("sample-server3", name)
|
self.assertEqual("sample-server3", name)
|
||||||
|
@ -221,7 +221,7 @@ class TestNovaDriver(base.TestCase):
|
||||||
self.driver._translate_services(service_list)
|
self.driver._translate_services(service_list)
|
||||||
expected_ret = {
|
expected_ret = {
|
||||||
1: [1, 'nova-compute', 'nova', 'nova1', 'enabled', 'up',
|
1: [1, 'nova-compute', 'nova', 'nova1', 'enabled', 'up',
|
||||||
'2015-07-28T08:28:37.000000', 'None'],
|
'2015-07-28T08:28:37.000000', None],
|
||||||
2: [2, 'nova-schedule', 'nova', 'nova1', 'disabled', 'up',
|
2: [2, 'nova-schedule', 'nova', 'nova1', 'disabled', 'up',
|
||||||
'2015-07-28T08:28:38.000000', 'daily maintenance']
|
'2015-07-28T08:28:38.000000', 'daily maintenance']
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,10 @@ def value_to_congress(value):
|
||||||
return str(value)
|
return str(value)
|
||||||
|
|
||||||
|
|
||||||
|
def tuple_to_congress(value_tuple):
|
||||||
|
return tuple(value_to_congress(v) for v in value_tuple)
|
||||||
|
|
||||||
|
|
||||||
# Note(thread-safety): blocking function
|
# Note(thread-safety): blocking function
|
||||||
def create_datasource_policy(bus, datasource, engine):
|
def create_datasource_policy(bus, datasource, engine):
|
||||||
# Get the schema for the datasource using
|
# Get the schema for the datasource using
|
||||||
|
|
Loading…
Reference in New Issue