ITDevLtd / MCVirt

MCVirt - Command line virtual machine management utility
http://mcvirt.itdev.co.uk
GNU General Public License v2.0
24 stars 7 forks source link

Upgrade to python3 #445

Open MatthewJohn opened 5 years ago

MatthewJohn commented 5 years ago

Python 2.7 supports ends in 2020.

MatthewJohn commented 5 years ago

Given python2.7 ends support this year (ish), this should be migrated ASAP

MatthewJohn commented 4 years ago

Latest test results:

======================================================================
ERROR: test_remove_user_account (mcvirt.test.auth_tests.AuthTests)
Delete a user through the parser.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mcvirt/test/auth_tests.py", line 65, in setUp
    self.test_user = self.create_test_user(self.TEST_USERNAME, self.TEST_PASSWORD)
  File "/usr/lib/python3/dist-packages/mcvirt/test/auth_tests.py", line 48, in create_test_user
    self.user_factory.create(username, password)
  File "/usr/local/lib/python3.5/dist-packages/Pyro4/core.py", line 171, in __call__
    return self.__send(self.__name, args, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Pyro4/core.py", line 428, in _pyroInvoke
    raise data
TypeError: b'b63d170e93146758ae4eb82c326f9766739dca84e03c8c8ba019346d6ec72c1a' is not JSON serializable

======================================================================
ERROR: test_clone_local (mcvirt.test.virtual_machine.virtual_machine_tests.VirtualMachineTests)
Test the VM cloning in MCVirt using the argument parser.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mcvirt/test/virtual_machine/virtual_machine_tests.py", line 211, in test_clone_local
    fh.write(test_data)
TypeError: write() argument must be str, not bytes

======================================================================
ERROR: test_clone_local (mcvirt.test.virtual_machine.virtual_machine_tests.VirtualMachineTests)
Test the VM cloning in MCVirt using the argument parser.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mcvirt/test/test_base.py", line 123, in tearDown
    self.stop_and_delete(self.test_vms['TEST_VM_1']['name'])
  File "/usr/lib/python3/dist-packages/mcvirt/test/test_base.py", line 197, in stop_and_delete
    vm_object.delete()
  File "/usr/local/lib/python3.5/dist-packages/Pyro4/core.py", line 171, in __call__
    return self.__send(self.__name, args, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Pyro4/core.py", line 428, in _pyroInvoke
    raise data
mcvirt.exceptions.ExternalStorageCommandErrorException: Error whilst removing logical volume:
External command failure. See MCVirt log for more information

======================================================================
ERROR: test_duplicate_local (mcvirt.test.virtual_machine.virtual_machine_tests.VirtualMachineTests)
Perform test_duplicate test with Local storage.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mcvirt/test/virtual_machine/virtual_machine_tests.py", line 269, in test_duplicate_local
    self.test_duplicate('Local')
  File "/usr/lib/python3/dist-packages/mcvirt/test/virtual_machine/virtual_machine_tests.py", line 281, in test_duplicate
    test_vm_parent = self.create_vm('TEST_VM_1', 'Local')
  File "/usr/lib/python3/dist-packages/mcvirt/test/test_base.py", line 162, in create_vm
    available_nodes=available_nodes)
  File "/usr/local/lib/python3.5/dist-packages/Pyro4/core.py", line 171, in __call__
    return self.__send(self.__name, args, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Pyro4/core.py", line 428, in _pyroInvoke
    raise data
mcvirt.exceptions.VmAlreadyExistsException: VM already exists

======================================================================
ERROR: test_create_backup_snapshot (mcvirt.test.virtual_machine.virtual_machine_tests.VirtualMachineTests)
Create VM backup snapshot.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mcvirt/test/virtual_machine/virtual_machine_tests.py", line 776, in test_create_backup_snapshot
    fh.write(test_data)
TypeError: write() argument must be str, not bytes

----------------------------------------------------------------------