Let's not fail if we can't run ssh-add or timedatectl to get the
SSH key or timezone.
["timedatectl", "show", "-p", "Timezone", "--value"],
text=True,
stdout=subprocess.PIPE,
+ check=False,
).stdout.strip()
- creds["firstboot.timezone"] = tz
+ if tz:
+ creds["firstboot.timezone"] = tz
if "firstboot.locale" not in creds:
creds["firstboot.locale"] = "C.UTF-8"
text=True,
stdout=subprocess.PIPE,
env=os.environ,
+ check=False,
).stdout.strip()
- creds["ssh.authorized_keys.root"] = key
+ if key:
+ creds["ssh.authorized_keys.root"] = key
return creds