Commit bab9f023 authored by Łukasz Nowak's avatar Łukasz Nowak

software/kvm: Switch to python3 only

There is no reason to keep python2 compatibility, as python3 flavour of the
KVM software release is good enough.
parent a4db08ad
[buildout]
extends =
software.cfg
[python]
part = python3
...@@ -40,6 +40,9 @@ parts = ${:common-parts} ...@@ -40,6 +40,9 @@ parts = ${:common-parts}
#XXX-Cedric : add list of keyboard layouts (azerty/us querty/...) parameter to qemu #XXX-Cedric : add list of keyboard layouts (azerty/us querty/...) parameter to qemu
[python]
part = python3
[python-with-eggs] [python-with-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_} interpreter = ${:_buildout_section_name_}
......
...@@ -60,8 +60,7 @@ skipUnlessKvm = unittest.skipUnless(has_kvm, 'kvm not loaded or not allowed') ...@@ -60,8 +60,7 @@ skipUnlessKvm = unittest.skipUnless(has_kvm, 'kvm not loaded or not allowed')
if has_kvm: if has_kvm:
setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass( setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath( os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
'software%s.cfg' % ("-py3" if six.PY3 else ""))))
# XXX Keep using slapos node instance --all, because of missing promises # XXX Keep using slapos node instance --all, because of missing promises
InstanceTestCase.slap._force_slapos_node_instance_all = True InstanceTestCase.slap._force_slapos_node_instance_all = True
else: else:
...@@ -1792,14 +1791,17 @@ class TestExternalDisk(InstanceTestCase, KvmMixin): ...@@ -1792,14 +1791,17 @@ class TestExternalDisk(InstanceTestCase, KvmMixin):
'w') as fh: 'w') as fh:
json.dump(slapos_resource, fh, indent=2) json.dump(slapos_resource, fh, indent=2)
# above is not enough: the presence of parameter is required in slapos.cfg # above is not enough: the presence of parameter is required in slapos.cfg
slapos_config = []
with open(cls.slap._slapos_config) as fh: with open(cls.slap._slapos_config) as fh:
slapos_config = fh.read() for line in fh.readlines():
slapos_config += '\n' + """ if line.strip() == '[slapos]':
[slapos] slapos_config.append('[slapos]\n')
instance_storage_home = %s slapos_config.append(
""" % (external_storage_path,) 'instance_storage_home = %s\n' % (external_storage_path,))
else:
slapos_config.append(line)
with open(cls.slap._slapos_config, 'w') as fh: with open(cls.slap._slapos_config, 'w') as fh:
fh.write(slapos_config) fh.write(''.join(slapos_config))
@classmethod @classmethod
def _setUpClass(cls): def _setUpClass(cls):
......
...@@ -19,6 +19,7 @@ extra = ...@@ -19,6 +19,7 @@ extra =
helloworld ${slapos.test.helloworld-setup:setup} helloworld ${slapos.test.helloworld-setup:setup}
hugo ${slapos.test.hugo-setup:setup} hugo ${slapos.test.hugo-setup:setup}
jupyter ${slapos.test.jupyter-setup:setup} jupyter ${slapos.test.jupyter-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
matomo ${slapos.test.matomo-setup:setup} matomo ${slapos.test.matomo-setup:setup}
monitor ${slapos.test.monitor-setup:setup} monitor ${slapos.test.monitor-setup:setup}
nextcloud ${slapos.test.nextcloud-setup:setup} nextcloud ${slapos.test.nextcloud-setup:setup}
......
...@@ -350,7 +350,6 @@ tests = ...@@ -350,7 +350,6 @@ tests =
# here, to check there's no promise issue when slapos node runs with Python 2. # here, to check there's no promise issue when slapos node runs with Python 2.
erp5 ${slapos.test.erp5-setup:setup} erp5 ${slapos.test.erp5-setup:setup}
fluentd ${slapos.test.fluentd-setup:setup} fluentd ${slapos.test.fluentd-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
metabase ${slapos.test.metabase-setup:setup} metabase ${slapos.test.metabase-setup:setup}
### ###
${:extra} ${:extra}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment