Python 3: fix glance.tests.functional.db.test_sqlalchemy
This patch fixes 3 issues: - "RuntimeError: dictionary changed size during iteration" - "TypeError: 'map' object is not subscriptable" - "TypeError: object of type 'map' has no len()" Change-Id: If52ab336512f37b6e5ad6c748bef7996c67cb71a
This commit is contained in:
parent
c366881f30
commit
6540f9319a
@ -1412,7 +1412,7 @@ def task_create(context, values, session=None):
|
||||
|
||||
def _pop_task_info_values(values):
|
||||
task_info_values = {}
|
||||
for k, v in values.items():
|
||||
for k, v in list(values.items()):
|
||||
if k in ['input', 'result', 'message']:
|
||||
values.pop(k)
|
||||
task_info_values[k] = v
|
||||
|
@ -253,8 +253,8 @@ def get_all(context, session, marker=None, limit=None,
|
||||
context, session, filters, marker,
|
||||
limit, sort_keys, sort_dirs, show_level)
|
||||
|
||||
return map(lambda ns: _out(ns, show_level, show_text_properties=False),
|
||||
artifacts)
|
||||
return [_out(ns, show_level, show_text_properties=False)
|
||||
for ns in artifacts]
|
||||
|
||||
|
||||
def _get_all(context, session, filters=None, marker=None,
|
||||
|
@ -206,7 +206,7 @@ def get_all(context, session, marker=None, limit=None,
|
||||
namespaces = _get_all(
|
||||
context, session, filters, marker, limit, sort_key, sort_dir)
|
||||
|
||||
return map(lambda ns: ns.to_dict(), namespaces)
|
||||
return [ns.to_dict() for ns in namespaces]
|
||||
|
||||
|
||||
def get(context, name, session):
|
||||
|
1
tox.ini
1
tox.ini
@ -43,6 +43,7 @@ commands =
|
||||
glance.tests.functional.test_cors_middleware \
|
||||
glance.tests.functional.test_logging \
|
||||
glance.tests.functional.db.test_simple \
|
||||
glance.tests.functional.db.test_sqlalchemy \
|
||||
glance.tests.functional.db.test_rpc_endpoint \
|
||||
glance.tests.functional.v1.test_multiprocessing \
|
||||
glance.tests.functional.v2.test_metadef_objects \
|
||||
|
Loading…
Reference in New Issue
Block a user