Repository: archlinux/archinstall

Issue:
Installation fails in encryption step  with DiskError and NameError
I tried to test the installer but hit this error while encrypting a partition. I followed the instructions in the [README](https://github.com/Torxed/archinstall#testing).

```
{
    "!encryption-password": "******",
    "!root-password": "******",
    "filesystem": "ext4",
    "harddrive": {
        "model": null,
        "path": "/dev/loop2",
        "size": "5G"
    },
    "hostname": "laptop",
    "keyboard-language": "l1",
    "mirror-region": {
       ...
    },
    "nic": {
        "nic": "wlp4s0"
    },
    "packages": [
        "firefox",
        "thunderbird"
    ],
    "profile": {
        "path": "/usr/lib/python3.9/site-packages/archinstall/profiles/gnome.py"
    },
    "superusers": {
        "admin": {
            "!password": "******"
        }
    },
    "timezone": "Europe/Berlin",
    "users": {}
}
```

```
Encrypting Partition(path=/dev/loop2p2, real_device=/dev/loop2, fs=ext4, rel_mountpoint=/) (This might take a while)
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.9/site-packages/archinstall/__main__.py", line 34, in <module>
    run_as_a_module()
  File "/usr/lib/python3.9/site-packages/archinstall/__main__.py", line 31, in run_as_a_module
    script.execute()
  File "/usr/lib/python3.9/site-packages/archinstall/lib/profiles.py", line 143, in execute
    self.spec.loader.exec_module(sys.modules[self.namespace])
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/archinstall/examples/guided.py", line 342, in <module>
    perform_installation_steps()
  File "/usr/lib/python3.9/site-packages/archinstall/examples/guided.py", line 283, in perform_installation_steps
    perform_installation(device=fs.find_partition('/'),
  File "/usr/lib/python3.9/site-packages/archinstall/lib/disk.py", line 422, in __exit__
    raise args[1]
  File "/usr/lib/python3.9/site-packages/archinstall/examples/guided.py", line 265, in perform_installation_steps
    partition.encrypt(password=passwd)
  File "/usr/lib/python3.9/site-packages/archinstall/lib/disk.py", line 263, in encrypt
    return handle.encrypt(self, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/archinstall/lib/luks.py", line 98, in encrypt
    raise DiskError(f'Could not encrypt volume "{partition.path}": {o}')
NameError: name 'o' is not defined
```

Congratulations on the inclusion in an official arch installer image! :partying_face: (Even if this turns out to be an April fools joke ;-)


Discussion:

Resolving patch:
diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py
--- a/archinstall/lib/luks.py
+++ b/archinstall/lib/luks.py
@@ -94,8 +94,8 @@ def encrypt(self, partition, password=None, key_size=512, hash_type='sha512', it
 			else:
 				raise err
 
-		if b'Command successful.' not in b''.join(cmd_handle):
-			raise DiskError(f'Could not encrypt volume "{partition.path}": {o}')
+		if b'Command successful.' not in (cmd_output := b''.join(cmd_handle)):
+			raise DiskError(f'Could not encrypt volume "{partition.path}": {cmd_output}')
 	
 		return key_file
 
@@ -126,4 +126,4 @@ def close(self, mountpoint=None):
 
 	def format(self, path):
 		if (handle := sys_command(f"/usr/bin/cryptsetup -q -v luksErase {path}")).exit_code != 0:
-			raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}')
\ No newline at end of file
+			raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}')


Test patch: