diff --git a/examples/answers-imsm.yaml b/examples/answers-imsm.yaml new file mode 100644 index 00000000..c809b1de --- /dev/null +++ b/examples/answers-imsm.yaml @@ -0,0 +1,35 @@ +#machine-config: examples/imsm.json +Welcome: + lang: en_US +Refresh: + update: no +Keyboard: + layout: us +Network: + accept-default: yes +Proxy: + proxy: "" +Mirror: + mirror: "http://us.archive.ubuntu.com" +Filesystem: + guided: yes + guided-label: "md126" +Identity: + realname: Ubuntu + username: ubuntu + hostname: ubuntu-server + # ubuntu + password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1' +SSH: + install_server: true + pwauth: false + authorized_keys: + - | + ssh-rsa AAAAAAAAAAAAAAAAAAAAAAAAA # ssh-import-id lp:subiquity +SnapList: + snaps: + hello: + channel: stable + is_classic: false +InstallProgress: + reboot: yes diff --git a/subiquity/client/controllers/filesystem.py b/subiquity/client/controllers/filesystem.py index 3a231c80..b0ba3f88 100644 --- a/subiquity/client/controllers/filesystem.py +++ b/subiquity/client/controllers/filesystem.py @@ -85,7 +85,12 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator): await asyncio.sleep(0.1) if self.answers['guided']: - disk = self.ui.body.form.disks[self.answers['guided-index']] + if 'guided-index' in self.answers: + disk = self.ui.body.form.disks[self.answers['guided-index']] + elif 'guided-label' in self.answers: + label = self.answers['guided-label'] + [disk] = [d for d in self.ui.body.form.disks + if d.label == label] method = self.answers.get('guided-method') self.ui.body.form.guided_choice.value = { 'disk': disk,