Yeah, the new logic should work fine.

An alternative for the older logic would be to skip uid < 1000 so we
ignore system users.

Applying something like this worked here:

--- /usr/share/subiquity/console_conf/controllers/identity.py   2018-08-07 
15:07:53.000000000 +0000
+++ identity.py 2020-07-03 03:12:47.405925882 +0000
@@ -58,9 +58,13 @@ def get_device_owner():
     except FileNotFoundError:
         return None
     with extrausers_fp:
-        passwd_line = extrausers_fp.readline()
-        if passwd_line and len(passwd_line) > 0:
-            passwd = passwd_line.split(':')
+        for line in extrausers_fp:
+            line = line.strip()
+            if not line:
+                continue
+            passwd = line.split(':')
+            if int(passwd[2]) < 1000:
+                continue 
             result = {
                 'realname': passwd[4].split(',')[0],
                 'username': passwd[0],

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1881588

Title:
  pre-seeding lxd on Core appliances breaks console-conf user creation

To manage notifications about this bug go to:
https://bugs.launchpad.net/snapd/+bug/1881588/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to