Make names always 'str'
Regardless of python version, always have names as 'str' type.
This commit is contained in:
parent
e7d89bcc0d
commit
9a26eec1ac
@ -60,6 +60,7 @@ class VMCollection(object):
|
||||
# FIXME: this will probably change
|
||||
for vm_data in vm_list_data.splitlines():
|
||||
vm_name, props = vm_data.decode('ascii').split(' ', 1)
|
||||
vm_name = str(vm_name)
|
||||
props = props.split(' ')
|
||||
new_vm_list[vm_name] = dict(
|
||||
[vm_prop.split('=', 1) for vm_prop in props])
|
||||
|
@ -257,7 +257,7 @@ class WrapperObjectsCollection(object):
|
||||
list_data = self.app.qubesd_call('dom0', self._list_method)
|
||||
list_data = list_data.decode('ascii')
|
||||
assert list_data[-1] == '\n'
|
||||
self._names_list = list_data[:-1].splitlines()
|
||||
self._names_list = [str(name) for name in list_data[:-1].splitlines()]
|
||||
|
||||
for name, obj in list(self._objects.items()):
|
||||
if obj.name not in self._names_list:
|
||||
|
@ -92,7 +92,7 @@ class Volume(object):
|
||||
return self._pool
|
||||
else:
|
||||
self._fetch_info()
|
||||
return self._info['pool']
|
||||
return str(self._info['pool'])
|
||||
|
||||
@property
|
||||
def vid(self):
|
||||
@ -101,7 +101,7 @@ class Volume(object):
|
||||
return self._vid
|
||||
else:
|
||||
self._fetch_info()
|
||||
return self._info['vid']
|
||||
return str(self._info['vid'])
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
@ -202,6 +202,8 @@ class Pool(object):
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, Pool):
|
||||
return self.name == other.name
|
||||
elif isinstance(other, str):
|
||||
return self.name == other
|
||||
return NotImplemented
|
||||
|
||||
def __lt__(self, other):
|
||||
|
Loading…
Reference in New Issue
Block a user