misc python3 fixes
This commit is contained in:
parent
9f7ba53eec
commit
1be75d9c83
@ -91,7 +91,7 @@ class Volume(object):
|
|||||||
self.pool = str(pool)
|
self.pool = str(pool)
|
||||||
self.internal = internal
|
self.internal = internal
|
||||||
self.removable = removable
|
self.removable = removable
|
||||||
self.revisions_to_keep = revisions_to_keep
|
self.revisions_to_keep = int(revisions_to_keep)
|
||||||
self.rw = rw
|
self.rw = rw
|
||||||
self.save_on_stop = save_on_stop
|
self.save_on_stop = save_on_stop
|
||||||
self._size = int(size)
|
self._size = int(size)
|
||||||
|
@ -129,7 +129,7 @@ class FilePool(qubes.storage.Pool):
|
|||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
result = p.communicate()
|
result = p.communicate()
|
||||||
|
|
||||||
m = re.match(r'^(/dev/loop\d+):\s', result[0])
|
m = re.match(r'^(/dev/loop\d+):\s', result[0].decode())
|
||||||
if m is not None:
|
if m is not None:
|
||||||
loop_dev = m.group(1)
|
loop_dev = m.group(1)
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ def init_cache(log=logging.getLogger('qube.storage.lvm')):
|
|||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
for line in out.splitlines():
|
for line in out.splitlines():
|
||||||
line = line.strip()
|
line = line.decode().strip()
|
||||||
pool_name, pool_lv, name, size, usage_percent, attr = line.split(',', 5)
|
pool_name, pool_lv, name, size, usage_percent, attr = line.split(',', 5)
|
||||||
if '' in [pool_name, pool_lv, name, size, usage_percent]:
|
if '' in [pool_name, pool_lv, name, size, usage_percent]:
|
||||||
continue
|
continue
|
||||||
|
@ -660,7 +660,7 @@ class SystemTestsMixin(object):
|
|||||||
try:
|
try:
|
||||||
volumes = subprocess.check_output(
|
volumes = subprocess.check_output(
|
||||||
['sudo', 'lvs', '--noheadings', '-o', 'vg_name,name',
|
['sudo', 'lvs', '--noheadings', '-o', 'vg_name,name',
|
||||||
'--separator', '/'])
|
'--separator', '/']).decode()
|
||||||
if ('/' + prefix) not in volumes:
|
if ('/' + prefix) not in volumes:
|
||||||
return
|
return
|
||||||
subprocess.check_call(['sudo', 'lvremove', '-f'] +
|
subprocess.check_call(['sudo', 'lvremove', '-f'] +
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import StringIO
|
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
@ -111,7 +111,7 @@ class TC_00_qvm_run(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
|
|
||||||
@unittest.skip('expected error')
|
@unittest.skip('expected error')
|
||||||
def test_005_colour_output(self):
|
def test_005_colour_output(self):
|
||||||
sys.stdout = StringIO.StringIO()
|
sys.stdout = io.StringIO()
|
||||||
qubes.tools.qvm_run.main(
|
qubes.tools.qvm_run.main(
|
||||||
self.sharedopts + ['--colour-output', '32', self.vm1.name, 'true'])
|
self.sharedopts + ['--colour-output', '32', self.vm1.name, 'true'])
|
||||||
self.assertEqual('\033[0;32m\033[0m', sys.stdout.getvalue())
|
self.assertEqual('\033[0;32m\033[0m', sys.stdout.getvalue())
|
||||||
|
@ -400,7 +400,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
|
|
||||||
maxmem = qubes.property('maxmem', type=int,
|
maxmem = qubes.property('maxmem', type=int,
|
||||||
setter=_setter_positive_int,
|
setter=_setter_positive_int,
|
||||||
default=(lambda self: min(self.app.host.memory_total / 1024 / 2, 4000)),
|
default=(lambda self:
|
||||||
|
int(min(self.app.host.memory_total / 1024 / 2, 4000))),
|
||||||
doc='''Maximum amount of memory available for this VM (for the purpose
|
doc='''Maximum amount of memory available for this VM (for the purpose
|
||||||
of the memory balancer).''')
|
of the memory balancer).''')
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ Requires: createrepo
|
|||||||
Requires: gnome-packagekit
|
Requires: gnome-packagekit
|
||||||
Requires: cronie
|
Requires: cronie
|
||||||
Requires: bsdtar
|
Requires: bsdtar
|
||||||
|
Requires: python3-jinja2
|
||||||
# for qubes-hcl-report
|
# for qubes-hcl-report
|
||||||
Requires: dmidecode
|
Requires: dmidecode
|
||||||
Requires: PyQt4
|
Requires: PyQt4
|
||||||
|
Loading…
Reference in New Issue
Block a user