mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Py3 compatibility fixes.
This commit is contained in:
parent
42d1bc49ee
commit
c3403bb949
@ -7,6 +7,12 @@ Used to display the output from the :mod:`virt.query <salt.runners.virt.query>`
|
||||
runner.
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import 3rd-party libs
|
||||
import salt.ext.six as six
|
||||
|
||||
|
||||
def output(data):
|
||||
'''
|
||||
@ -30,7 +36,7 @@ def output(data):
|
||||
id_,
|
||||
vm_data['graphics']['port'])
|
||||
if 'disks' in vm_data:
|
||||
for disk, d_data in vm_data['disks'].items():
|
||||
for disk, d_data in six.iteritems(vm_data['disks']):
|
||||
out += ' Disk - {0}:\n'.format(disk)
|
||||
out += ' Size: {0}\n'.format(d_data['disk size'])
|
||||
out += ' File: {0}\n'.format(d_data['file'])
|
||||
@ -38,6 +44,7 @@ def output(data):
|
||||
if 'nics' in vm_data:
|
||||
for mac in vm_data['nics']:
|
||||
out += ' Nic - {0}:\n'.format(mac)
|
||||
out += ' Source: {0}\n'.format(vm_data['nics'][mac]['source'][next(vm_data['nics'][mac]['source'].iterkeys())])
|
||||
out += ' Source: {0}\n'.format(
|
||||
vm_data['nics'][mac]['source'][next(six.iterkeys(vm_data['nics'][mac]['source']))])
|
||||
out += ' Type: {0}\n'.format(vm_data['nics'][mac]['type'])
|
||||
return out
|
||||
|
Loading…
Reference in New Issue
Block a user