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
|
# FIXME: this will probably change
|
||||||
for vm_data in vm_list_data.splitlines():
|
for vm_data in vm_list_data.splitlines():
|
||||||
vm_name, props = vm_data.decode('ascii').split(' ', 1)
|
vm_name, props = vm_data.decode('ascii').split(' ', 1)
|
||||||
|
vm_name = str(vm_name)
|
||||||
props = props.split(' ')
|
props = props.split(' ')
|
||||||
new_vm_list[vm_name] = dict(
|
new_vm_list[vm_name] = dict(
|
||||||
[vm_prop.split('=', 1) for vm_prop in props])
|
[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 = self.app.qubesd_call('dom0', self._list_method)
|
||||||
list_data = list_data.decode('ascii')
|
list_data = list_data.decode('ascii')
|
||||||
assert list_data[-1] == '\n'
|
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()):
|
for name, obj in list(self._objects.items()):
|
||||||
if obj.name not in self._names_list:
|
if obj.name not in self._names_list:
|
||||||
|
@ -92,7 +92,7 @@ class Volume(object):
|
|||||||
return self._pool
|
return self._pool
|
||||||
else:
|
else:
|
||||||
self._fetch_info()
|
self._fetch_info()
|
||||||
return self._info['pool']
|
return str(self._info['pool'])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vid(self):
|
def vid(self):
|
||||||
@ -101,7 +101,7 @@ class Volume(object):
|
|||||||
return self._vid
|
return self._vid
|
||||||
else:
|
else:
|
||||||
self._fetch_info()
|
self._fetch_info()
|
||||||
return self._info['vid']
|
return str(self._info['vid'])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def size(self):
|
def size(self):
|
||||||
@ -202,6 +202,8 @@ class Pool(object):
|
|||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if isinstance(other, Pool):
|
if isinstance(other, Pool):
|
||||||
return self.name == other.name
|
return self.name == other.name
|
||||||
|
elif isinstance(other, str):
|
||||||
|
return self.name == other
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
|
Loading…
Reference in New Issue
Block a user