From d824742aff1340298a4453fd1c759db8d9fc3962 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 24 Jul 2023 13:48:34 +1200 Subject: [PATCH] do not require identity data when reset_partition_only --- examples/autoinstall/reset-only.yaml | 5 ----- subiquity/server/controllers/identity.py | 10 +++++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/autoinstall/reset-only.yaml b/examples/autoinstall/reset-only.yaml index cb4eedf5d..f45ae52db 100644 --- a/examples/autoinstall/reset-only.yaml +++ b/examples/autoinstall/reset-only.yaml @@ -1,9 +1,4 @@ version: 1 -identity: - realname: '' - username: ubuntu - password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1' - hostname: ubuntu storage: layout: name: direct diff --git a/subiquity/server/controllers/identity.py b/subiquity/server/controllers/identity.py index d32e3754b..759c03b25 100644 --- a/subiquity/server/controllers/identity.py +++ b/subiquity/server/controllers/identity.py @@ -85,9 +85,13 @@ def load_autoinstall_data(self, data): @with_context() async def apply_autoinstall_config(self, context=None): - if not self.model.user: - if 'user-data' not in self.app.autoinstall_config: - raise Exception("no identity data provided") + if self.model.user: + return + if 'user-data' in self.app.autoinstall_config: + return + if self.app.base_model.target is None: + return + raise Exception("no identity data provided") def make_autoinstall(self): if self.model.user is None: