Forgot an import, as well as made BlockDevice() have less verbose output on json.dumps.

This commit is contained in:
Anton Hvornum 2020-10-18 20:26:09 +02:00
parent 3d4eaec466
commit fa4be63e48
2 changed files with 12 additions and 1 deletions

View File

@ -25,6 +25,16 @@ class BlockDevice():
raise KeyError(f'{self} does not contain information: "{key}"')
return self.info[key]
def json(self):
"""
json() has precedence over __dump__, so this is a way
to give less/partial information for user readability.
"""
return {
'path' : self.path,
'size' : self.info['size'] if 'size' in self.info else '<unknown>'
}
def __dump__(self):
return {
'path' : self.path,

View File

@ -1,4 +1,5 @@
import archinstall, getpass, time, json
import archinstall
import getpass, time, json, sys
def perform_installation(device, boot_partition, language, mirrors):
"""