Fix indexing of dict.keys() in python3

It will throw TypeError when you try to operate on
dict.keys() like a list in python3.
ref:https://docs.python.org/3/library/stdtypes.html#dictionary-view-objects

Partially implements blueprint: nova-python3-mitaka

Change-Id: I44fc5ceb4f533f0e3628bddc1b394cf5e6573a82
This commit is contained in:
Bo Wang 2016-01-15 00:48:35 +08:00
parent 4d7a594a1c
commit 608b7d9047

View File

@ -85,7 +85,7 @@ def _get_domain_0(session):
this_host_ref = session.xenapi.session.get_this_host(session.handle)
expr = 'field "is_control_domain" = "true" and field "resident_on" = "%s"'
expr = expr % this_host_ref
return session.xenapi.VM.get_all_records_where(expr).keys()[0]
return list(session.xenapi.VM.get_all_records_where(expr).keys())[0]
def with_vdi_in_dom0(session, vdi, read_only, f):