Commit Graph

2111 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 744e53b76b move checking if a layout needs a toggle to server side
subiquity inherits this behavior from d-i where if a the user selects a
layout that does not allow typing latin characters, the user is prompted
to choose a key to toggle between the one they selected and a related
one that does allow latin characters. This change moves the handling of
this to the server side, so the client just sees the keyboard layout the
user selects, and calls an API method to know if to ask the user about a
toggle key.
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle 7d98a77434 move keyboard detection to server side 2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle fb649bf7d5 pre-process keyboard auto detection steps into API friendly format
Continuing the theme of previous work, this branch parses pc105.tree
into API-friendly attr-based classes at snap build time (which also lets
us check some constraints then and not at run time).
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle 5d93eb824a process keyboard data into api friendly format when building snap
This is a bit sideways from the real thing I'm working on which is
moving most of the logic of keyboard handling to the server side but
anyway. This also lets me check some assumptions while processing the
data rather than in the view code.
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle da14af1c65 add serialization support for unions of attr classes
unions are serialized as a tagged union by adding a '$type' field
indicating which member of the set of types is present.
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle 85ed9826e4 add support for serializing typing.Dict 2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle 0526b150c3 enforce that the serialization module rejects non-string-key dicts
I tend to forget that json dictionaries can only have string keys. I'll
add support for explicitly typed, non-string-keyed, dicts at some
point...
2021-03-16 16:02:23 +13:00
Michael Hudson-Doyle 7b954869ad
Merge pull request #906 from mwhudson/compact-serialization
add a more compact way of serializing objects
2021-03-16 09:32:38 +13:00
Mauricio Faria de Oliveira 0205a74fc6 lvm_partition: align down all remaining space to chunk size
If an autoinstall storage config with the last lvm_partition
is set to use all remaining space in the volgroup (size: -1)
and it is not aligned with the lvm chunk size, lvcreate will
round it up, and that will not fit into the actual free size.

That might happen depending on the size used by the previous
(lvm) partitions (e.g., may use percentage) and size of disk.

Fix that by rounding it down to the LVM chunk size.
This passed 'make check' and 'make lint' with exit code 0.

LP: #1919053

Before:

    Running command ['lvcreate', 'vg', '--name', 'lv-root', '--zero=y',
    '--wipesignatures=y', '--size', '6435110912.0B'] with allowed return
    codes [0] (capture=False)
      Rounding up size to full physical extent <6.00 GiB
      Volume group "vg" has insufficient free space (1534 extents): 1535
    required.
    An error occured handling 'lvm-lv-root': ProcessExecutionError -
    Unexpected error while running command.

After:

    Running command ['lvcreate', 'vg', '--name', 'lv-root', '--zero=y',
    '--wipesignatures=y', '--size', '6434062336.0B'] with allowed return
    codes [0] (capture=False)
    Logical volume "lv-root" created.

Check:

    $ python3 -q
    >>> 6435110912 / (4*1024**2)
    1534.25

    >>> 6435110912 & ~(4*1024**2-1)
    6434062336
    >>> _ / (4*1024**2)
    1534.0

Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
2021-03-13 21:46:24 -03:00
Michael Hudson-Doyle 4fc042ce1f add a more compact way of serializing objects
This adds a way of serializing objects to lists, which makes the results
much less self-documenting but also much smaller.  (I want to ship
keyboard data serialized with this code with the snap, but do not really
want to ship JSON data that is way bigger than it needs to be.)
2021-03-11 16:01:40 +13:00
Michael Hudson-Doyle 41e42e0f39 improve lvm name validation message a bit 2021-03-09 17:30:32 +13:00
Michael Hudson-Doyle 7f7866919a support deleting a VG and creating one with the same name 2021-03-09 17:27:20 +13:00
Michael Hudson-Doyle 3a54e8b107 do not try to reuse a name of an existing vg in guided_lvm
for https://bugs.launchpad.net/bugs/1905412
2021-03-09 16:13:29 +13:00
Michael Hudson-Doyle 82e20f27cf simplify schema generation
autoinstall stuff is a strictly server side thing
2021-03-04 10:52:38 +13:00
Dan Bungert 3ac6785e2a Fix lint 2021-03-03 11:38:39 -07:00
Dan Bungert 906d081273 Fix schema generation
It seems this schema generation tool was not updated with the big
server/client seperation.  Address that.
2021-03-03 11:11:41 -07:00
Michael Hudson-Doyle 58af29b933 update github urls to new organization 2021-02-23 12:03:37 +13:00
Michael Hudson-Doyle a76581cd2b
Merge pull request #898 from mwhudson/lp-1912957
do not stop listening to curtin events when the curtin process exits
2021-02-22 11:52:04 +13:00
Michael Hudson-Doyle 3cf514436f do not stop listening to curtin events the instant the curtin process exits 2021-02-19 15:33:02 +13:00
Michael Hudson-Doyle 38f5c0ebdf another locale fix 2021-02-19 15:28:25 +13:00
Michael Hudson-Doyle 2b3476002e fix initial language selection
there were two issues: the client never set up translation based on the
initial setting and the server contined to strip ".UTF-8" off the $LANG
value so the client didn't find a matching value to highlight the
initial language correctly.
2021-02-18 13:35:17 +13:00
Michael Hudson-Doyle 458dad5744
Merge pull request #889 from mwhudson/lp-1913417
fix crash on refresh: change ids are strings in the snapd api
2021-02-15 11:12:26 +13:00
Michael Hudson-Doyle 0f1b1646a9 be a bit smarter about the locale that gets written to the cloud init config 2021-02-12 15:03:10 +13:00
Michael Hudson-Doyle a8610e205a fix lint 2021-02-12 15:02:44 +13:00
Michael Hudson-Doyle 5593f305b1 fix cloud-init status invocation 2021-02-12 13:57:54 +13:00
Michael Hudson-Doyle 8943b253e4
Merge pull request #879 from mwhudson/start-api-server-before-cloud-init
wait for cloud-init to complete after starting api server
2021-02-12 10:39:54 +13:00
Michael Hudson-Doyle 6fa1d9bbd0 fix crash on refresh: change ids are strings in the snapd api
for https://bugs.launchpad.net/subiquity/+bug/1913417
2021-02-10 11:43:58 +13:00
Michael Hudson-Doyle beae2d4974
Merge pull request #881 from mwhudson/lp-1912967
switch language in the client, not the server
2021-01-27 11:21:25 +13:00
Daniel Bungert e923d14128 Remove create_task() workaround
With a better fix in place in wait_with_text_dialog(), this explicit
create_task() is no longer needed.
2021-01-26 14:47:42 -07:00
Daniel Bungert 6b34f80a90 client: lookup machine IPs via API call
Attempts to look them up directly fail due to an empty app.base_model.
Add an API call invocation to grab the public IPs.
2021-01-26 13:49:05 -07:00
Michael Hudson-Doyle fac0eeed43 fix crash when trying to view nic info
fixes half of https://bugs.launchpad.net/subiquity/+bug/1912955
2021-01-27 09:35:09 +13:00
Michael Hudson-Doyle 5e91518a40 switch language in the client, not the server 2021-01-26 16:34:49 +13:00
Michael Hudson-Doyle ae025fa395 wait for cloud-init to complete after starting api server
Currently the api server waits for cloud-init to complete very very
early, before starting the API server. This can leave the client at a
message that just says "connecting...." for quite a few seconds. This
branch adds a couple more states to ApplicationState to use during
startup and has the client print appropriate messages for each one.
2021-01-22 16:32:51 +13:00
Michael Hudson-Doyle 49b9b08afb pass data about dasds from server to client
so the ptable ends up being correct
2021-01-15 12:17:26 +13:00
Michael Hudson-Doyle b515055a55
Merge pull request #877 from mwhudson/lp-1908123
print the usual stuff to the console on s390x for a non-interactive a…
2021-01-13 08:57:34 +13:00
Michael Hudson-Doyle 2c10573480 fix restarting of server process 2021-01-12 16:03:26 +13:00
Michael Hudson-Doyle 9ee4e68cc6 print the usual stuff to the console on s390x for a non-interactive autoinstall 2021-01-07 13:12:45 +13:00
Michael Hudson-Doyle b13dabba85
Merge pull request #867 from mwhudson/disk-matching-fixes
check udev data directly when processing match: specs
2021-01-06 13:56:05 +13:00
Michael Hudson-Doyle f4618cbdaa ensure probing errors get reported properly during an autoinstall 2020-12-18 14:42:01 +13:00
Michael Hudson-Doyle 4cdfe469e7 run error commands on failure 2020-12-18 14:42:01 +13:00
Michael Hudson-Doyle 4de9668a17 handle top-level exceptions as documented
Also let install failures be handled at this level.
2020-12-18 14:42:01 +13:00
Michael Hudson-Doyle c77d6b402a document how error handling should work 2020-12-18 14:42:01 +13:00
Michael Hudson-Doyle 0ad21b7c96 smoosh InstallState into ApplicationState
Having these be separate was slightly confusing, particular as I need to
add an "ERROR" state that isn't necessarily due to the install step
itself failing. Now we have one enum for the overall status of the
installer and a separate field that indicates whether the client should
be in interactive or non-interactive mode (or "not-yet-known" which is
handled more or less like non-interactive mode).
2020-12-18 14:41:35 +13:00
Michael Hudson-Doyle 4798b7f9a5
Merge pull request #871 from mwhudson/exception-to-error-report
add a way of mapping an exception to an error report
2020-12-18 14:39:58 +13:00
Michael Hudson-Doyle 83ccaa7f1c
Merge pull request #872 from mwhudson/autoinstall-refresh-update-no
putting "update: no" in autoinstall for refresh section should prevent update
2020-12-18 14:39:33 +13:00
Michael Hudson-Doyle 3161a1fb08 putting "update: no" in autoinstall for refresh section should prevent update
Crazily, the code interpreted the presence of an 'update' key as meaning
a refresh should be attempted and ignored its value.
2020-12-18 13:41:10 +13:00
Michael Hudson-Doyle 369c0f896e have the client unconditionally print whatever comes over one syslog id
This makes the code to print the output from early commands a bit
simpler, and would make the output of error commands visible if anything
actually ran the error commands (coming soon to a PR near you!)
2020-12-18 12:50:37 +13:00
Michael Hudson-Doyle 2154b03d0e add a way of mapping an exception to an error report
I am going to add code that generates an error report for an unhandled
exception soon and we do not want to generate two reports for one
exception...
2020-12-18 12:29:53 +13:00
Michael Hudson-Doyle 33bdc89f35 add a test of vendor globbing, improve other tests a bit 2020-12-16 15:39:44 +13:00
Michael Hudson-Doyle 50328edf7f actually set up dasd object correctly :/ 2020-12-16 10:24:27 +13:00
Michael Hudson-Doyle 74732158f3 calculate the capacity of an unformatted dasd by hand 2020-12-16 10:24:27 +13:00
Michael Hudson-Doyle 68254bb23c have ptable_for_new_partition return msdos for FBA dasd and vtoc for all others
this has the side effect that dasds passed via virtio get vtoc partition tables
2020-12-16 10:24:27 +13:00
Michael Hudson-Doyle 007dd3e5ef tidy up answers handling a bit and fix a race 2020-12-16 10:21:32 +13:00
Michael Hudson-Doyle 43601b8d79
Merge pull request #865 from mwhudson/stop-probing-when-filesystem-configured
stop listening to udev events when the filesystem gets configured
2020-12-15 23:47:00 +13:00
Michael Hudson-Doyle ac6c84a78b check udev data directly when processing match: specs
also allow matching on ID_VENDOR
2020-12-09 11:39:55 +13:00
Michael Hudson-Doyle 32dbf28767 only wait 10 minutes for cloud-init status --wait to complete, not forever
and show a message to the user when this happens
2020-12-08 21:43:38 +13:00
Michael Hudson-Doyle bbcf050205 move waiting for cloud-init to server, where it makes sense 2020-12-08 21:05:36 +13:00
Michael Hudson-Doyle 0f23e61c59 stop listening to udev events when the filesystem gets configured
Otherwise subiquity kicks off probes when there are the inevitable block
device changes during the installation, which is at best useless but
seems to occasionally cause install failures too.
2020-12-08 12:37:32 +13:00
Dimitri John Ledkov f958015e2c
Merge pull request #855 from mwhudson/lp-1887669
have dependencies/reverse_dependencies consider the relationship betw…
2020-11-09 16:26:37 +00:00
Michael Hudson-Doyle 303c0d75d6 move reboot controller (the last one!) to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 4367f8f97c move snaplist controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 4ab676d984 move ssh controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle bd69f2a746 move identity controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 4adae88563 move filesystem controller to new world
this cheats a bit and has an instance of FilesystemModel in both the server and the client
2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 50896cc214 add second showing of refresh screen 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 6609114201 move mirror controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle c264884c0c move proxy controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 7f41803418 move network controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle e9071a00ca move zdev controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 45a85c554e move keyboard controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle aac00dad6c move refresh controller to new world 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 7faa1634ff move controllers with no api presence to server 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 3367b41cf1 split welcome controller into locale (server) and welcome (client) 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 3c30e14313 split installprogress controller into install (server) and progress (client) 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle 92252f8119 split subiquity.controller into client and server versions 2020-11-04 10:57:22 +13:00
Michael Hudson-Doyle aad036d925 split subiquity.core into subiquity.client.client and subiquity.server.server 2020-11-04 10:57:22 +13:00
Dimitri John Ledkov a8a8656818
welcome: fix crash on serial ip addresses
LP: #1900707
2020-10-20 14:52:48 +01:00
Michael Hudson-Doyle be02b57791 have dependencies/reverse_dependencies consider the relationship between dasd and disk 2020-10-16 12:29:10 +13:00
Michael Hudson-Doyle 426e55e13f normalize subiquity/controllers/__init__.py 2020-10-12 14:11:02 +13:00
Michael Hudson-Doyle d6f3f83622 run network answers in run_answers 2020-10-12 11:58:08 +13:00
Michael Hudson-Doyle f89b9e692a asyncioify "fine grained action" handling a bit 2020-10-12 11:16:38 +13:00
Michael Hudson-Doyle 4364a7ad1a feed progress view via journal
this means curtin events go through the journal twice, but that has to happen
when client and server get split
2020-10-09 14:48:38 +13:00
Michael Hudson-Doyle 780cfe1e7c very minor installprogress refactoring 2020-10-09 13:55:45 +13:00
Michael Hudson-Doyle 7303d68847 introduce a couple more installstates 2020-10-09 13:39:09 +13:00
Michael Hudson-Doyle 673ade7f2a make core interface a little simpler 2020-10-09 13:12:09 +13:00
Michael Hudson-Doyle c03f6580fd move more code that should never have been so generic 2020-10-09 13:08:15 +13:00
Michael Hudson-Doyle 2bf981ebb8 move "last-screen" handling out of generic code 2020-10-09 13:07:04 +13:00
Michael Hudson-Doyle 7d22e299bd do not call setup_autoinstall as part of __init__ 2020-10-09 13:00:14 +13:00
Michael Hudson-Doyle 9a8ef486d8
Merge pull request #848 from mwhudson/better-server-subproc-handling
handle automatically run server processes in dry-run mode better
2020-10-06 22:25:39 +13:00
Michael Hudson-Doyle 83f03089aa handle automatically run server processes in dry-run mode better
otherwise, when we start adding server restarts to the mix, it is easy to
end up with multiple server processes running
2020-10-06 17:21:51 +13:00
Michael Hudson-Doyle 31cf346cb2 add missing __init__.py to subiquity/server 2020-09-30 11:37:19 +13:00
Michael Hudson-Doyle a25ef1b933 make a certain kind of test failure clearer 2020-09-25 14:33:53 +12:00
Michael Hudson-Doyle e8b73a7ca7 include path to problem when serialization fails 2020-09-25 14:33:53 +12:00
Michael Hudson-Doyle f37f2b08aa
Merge pull request #843 from mwhudson/dead-code
remove some dead code
2020-09-23 16:08:01 +12:00
Michael Hudson-Doyle 8dc97707fe
Merge pull request #841 from mwhudson/skip-confirm
handling skipping controllers and confirmation in client/server comms
2020-09-23 16:07:48 +12:00
Michael Hudson-Doyle 49f767449a remove some dead code 2020-09-23 15:44:20 +12:00
Michael Hudson-Doyle e3d6bf9562 do not run answers for view that is skipped 2020-09-23 15:38:43 +12:00
Michael Hudson-Doyle a78cd1a021 handle skipping controllers and confirmation in client/server calls 2020-09-23 14:56:36 +12:00
Michael Hudson-Doyle 9cb66cdc71 refactor how we tell when to show confirmation a bit 2020-09-23 14:56:36 +12:00
Michael Hudson-Doyle 59364a737e add (trivial) server controller base class 2020-09-23 14:56:27 +12:00
Michael Hudson-Doyle 22836200f1 restart the client if the server is updated 2020-09-23 13:59:11 +12:00
Michael Hudson-Doyle 6647d88c14 generate the error report for a request failure in the server
this requires a bit of plumbing for the client to be able to show an error report
that has just been created in another process
2020-09-23 11:02:02 +12:00
Michael Hudson-Doyle 3458227e94 have clicking restart in an error view restart the server too 2020-09-23 11:01:56 +12:00
Michael Hudson-Doyle 913a5262a2 create and show an error report when a server request fails 2020-09-23 10:48:39 +12:00
Michael Hudson-Doyle 9ce19db20c add a dry-run only api method that crashes and a key to call it 2020-09-23 10:47:35 +12:00
Michael Hudson-Doyle 25b9cf4c99 make serialization api a touch easier to use 2020-09-23 10:30:05 +12:00
Michael Hudson-Doyle edc43ff811 add a minimal server process
run it automatically in dry-run mode
2020-09-22 14:43:26 +12:00
Michael Hudson-Doyle 54793283ef make refresh view/controller interface more client/server friendly
maybe. a bit.
2020-09-22 12:09:17 +12:00
Michael Hudson-Doyle ee764da84d
Merge pull request #834 from mwhudson/error-report-ref
add a type to act as a sort of serializable "handle" for an error report
2020-09-22 10:41:11 +12:00
Michael Hudson-Doyle 94de120d16 add a type to act as a sort of serializable "handle" for an error report 2020-09-21 22:25:58 +12:00
Michael Hudson-Doyle 7d02ee17f6 make zdev view/controller interface more client/server friendly 2020-09-21 21:04:14 +12:00
Michael Hudson-Doyle d92c8e862a
Merge pull request #832 from mwhudson/keyboard-view-changes
make keyboard view/controller interface more client/server friendly
2020-09-21 21:02:35 +12:00
Michael Hudson-Doyle 1ac81c41b5
Merge pull request #831 from mwhudson/welcome-view-changes
make welcome view/controller interface more client/server friendly
2020-09-21 21:01:00 +12:00
Michael Hudson-Doyle 70fc2e64cd make keyboard view/controller interface more client/server friendly 2020-09-21 14:56:47 +12:00
Michael Hudson-Doyle cfa56ff821 make welcome view/controller interface more client/server friendly 2020-09-21 14:28:13 +12:00
Michael Hudson-Doyle a8a56e908f tidy up interface between progress view and controller 2020-09-21 14:13:07 +12:00
Michael Hudson-Doyle bc6c66efbb give contexts an id and have progressview track them by id not identity 2020-09-21 14:01:40 +12:00
Michael Hudson-Doyle 219360d12d fixes for how install failures are presented
some of these have been around for a while :/
2020-09-21 14:01:23 +12:00
Michael Hudson-Doyle 0a8c6b506e small refactor 2020-09-21 11:39:34 +12:00
Michael Hudson-Doyle e43e3cca14 make the interface between snaplist view and controller client-server friendly 2020-09-21 11:21:42 +12:00
Michael Hudson-Doyle 22fbfdcbdd
Merge pull request #827 from mwhudson/asyncify-make_ui
allow make_ui to be async
2020-09-21 10:42:03 +12:00
Michael Hudson-Doyle aaa0b9a48d stop proxy and mirror views referring directly to model
nearly trivial, this one
2020-09-18 22:39:52 +12:00
Michael Hudson-Doyle 084b3c2396 make sshview refer to a simple type 2020-09-18 22:37:35 +12:00
Michael Hudson-Doyle d0667e7f12 make identityview refer to a simple type 2020-09-18 22:25:24 +12:00
Michael Hudson-Doyle 56441c6f97 small tidies 2020-09-18 22:01:36 +12:00
Michael Hudson-Doyle 9b414df0eb add a helper to wait and show a dialog if needed
use this in snaplist view. cancellation with asyncio is mindbending!
2020-09-18 21:51:14 +12:00
Michael Hudson-Doyle a7bcc7faf0 add a way to wait for something with notification after 0.1s
use this for moving between screens, removing some crummy code from subquity/core.py
2020-09-18 21:18:27 +12:00
Michael Hudson-Doyle 6c258d6da4 allow make_ui to be a coroutine 2020-09-18 11:52:19 +12:00
Michael Hudson-Doyle f0082c2068 change controller api to return a view, rather than setting it 2020-09-18 11:44:00 +12:00
Michael Hudson-Doyle eb5dba579e handle answers in a separate method 2020-09-18 11:18:08 +12:00
Michael Hudson-Doyle e786461b86 make the api for listening to the journal a bit nicer 2020-09-18 09:55:51 +12:00
Michael Hudson-Doyle aa3bce4414 do not run the urwid loop at all when not interactive 2020-09-18 09:54:50 +12:00
Michael Hudson-Doyle 45009e3a12 refactor startup a little
the point of this is to have the event loop running while loading
autoinstall commands, which means we do not have to start and stop the
event loop inside load_autoinstall_config if there are early-commands to
run.
2020-09-18 09:54:50 +12:00
Michael Hudson-Doyle 04e5cf95b0
Merge pull request #823 from mwhudson/add-api
add api definition and support code for client server split
2020-09-18 09:53:44 +12:00
Michael Hudson-Doyle 19178979fc restore KeyCodesFilter, somehow dropped during refactoring 2020-09-17 11:18:52 +12:00
Michael Hudson-Doyle 1091ced495 address review comments 2020-09-16 09:47:03 +12:00
Michael Hudson-Doyle c7e9445ad1 add subiquity.common.api
This somewhat overengineered code allows you to define an API in a
sort-of DSL and then automatically make a client, and implement it bit
by bit server side.
2020-09-11 16:56:30 +12:00
Michael Hudson-Doyle 01e9c04ab5
Merge pull request #817 from mwhudson/tuiapplication
remove all UI code from "core" application object, add tuiapplication
2020-09-10 11:31:30 +12:00
Michael Hudson-Doyle f32c74c86d address review comments 2020-09-03 12:31:25 +12:00
Michael Hudson-Doyle 0ce2043061
Merge pull request #820 from shuuji3/fix-typo-on-welcome-screen
Fix a typo: "unicde" to "unicode"
2020-09-03 11:39:23 +12:00
Michael Hudson-Doyle 207f46a00b set crash directory in non dry-run builds (oops) 2020-09-02 21:52:49 +12:00
TAKAHASHI Shuuji 17b6cae372
Fix a typo: "unicde" to "unicode" 2020-08-29 13:28:07 +09:00
Michael Hudson-Doyle 279676a013
Merge pull request #815 from mwhudson/lp-1890651
only use wwn as a disk label if it is set
2020-08-25 09:49:43 +12:00
Michael Hudson-Doyle edc65dbbfb make the base controller have no ui, add subclass for one that has ui 2020-08-23 23:18:28 +12:00
Michael Hudson-Doyle f5f8a8a75c import the controllers module explicitly 2020-08-23 23:18:28 +12:00
Michael Hudson-Doyle ccd8c2382e split urwid-using bits out of subiquitycore.core.Application 2020-08-23 23:18:26 +12:00
Michael Hudson-Doyle 2e20c5d094
Merge pull request #806 from mwhudson/add-subiquity.common
add subiqity.common package and more error report handling to it
2020-08-23 22:44:43 +12:00
Michael Hudson-Doyle 63f5f57f30
Merge pull request #804 from mwhudson/screen-refactor
Move the code for setting up the screen to its own file
2020-08-23 22:43:42 +12:00
Michael Hudson-Doyle 3d94d28bbd only use wwn as a disk label if it is set 2020-08-21 10:06:27 +12:00
Dimitri John Ledkov c1ed2b5196
Revert "add all documented fields to filesystem model classes"
The above commit introduced regression
https://bugs.launchpad.net/subiquity/+bug/1889749

This means that https://bugs.launchpad.net/subiquity/+bug/1889749
remains unfixed.

This reverts commit 73f311690e.
2020-07-31 14:56:12 +01:00
Dimitri John Ledkov c7aff1fed5
snaplist: fix snaplist with filesystem without snaps
When no snaps are seeded in the filesystem, empty string is returned,
which yaml safe load interprets as None.

But snapd seed.yaml is defined as a dictionary with snaps key. Ensure
that when no seed.yaml is present (or readable), that at least an
empty dictionary is returned, such that later calls to `.get("snaps",
[])` succeed.

LP: #1889429
2020-07-29 16:26:12 +01:00
Michael Hudson-Doyle 2e5456fd55 add subiqity.common package and more error report handling to it
Both the subiquity client and server are going to want to use this code,
so move it somewhere more neutral.
2020-07-28 14:02:32 +12:00
Michael Hudson-Doyle 3d4158dde3
Merge pull request #793 from eliasp/typo-minumum
Fix typo (minumum > minimum)
2020-07-28 09:34:35 +12:00
Michael Hudson-Doyle 210cdcb51b Move the code for setting up the screen to its own file
Looking at this code thinking about the coming client / server split
made me realise that we could start by at least moving this
functionality to a more encapsulated place.
2020-07-27 23:40:17 +12:00
Michael Hudson-Doyle 9b533ad522
Merge pull request #801 from mwhudson/lp-1887997
fix some simple crashes seen in the error tracker
2020-07-27 10:34:50 +12:00
Michael Hudson-Doyle 1b075af043 be more careful accessing local_help method
not really sure how this happens, but there are some crashes in the error tracker
so...
2020-07-22 12:33:00 +12:00
Michael Hudson-Doyle 1257ead61b fix crash on checking for update failing 2020-07-22 12:29:05 +12:00
Michael Hudson-Doyle 744787ae7c fix editing a logical volume 2020-07-22 12:25:04 +12:00
Michael Hudson-Doyle c0d3138b48 a snap refresh failure means the refresh state is unknown
for https://bugs.launchpad.net/subiquity/+bug/1886816
2020-07-15 20:45:41 +12:00
Michael Hudson-Doyle 317648aec4
Merge pull request #794 from mwhudson/lp-1881588
use snapd apis to check for users
2020-07-10 08:37:51 +12:00
Michael Hudson-Doyle 73f311690e add all documented fields to filesystem model classes
This lets autoinstall configs set them, even though nothing in subiquity
can set them yet.
2020-07-02 16:35:17 +12:00
Michael Hudson-Doyle 9271f17dd2 move subiquity.snapd to subiquitycore.snapd 2020-07-02 12:56:49 +12:00
Elias Probst cc630d7d0c
Fix typo (minumum > minimum) 2020-06-29 14:23:12 +00:00
Michael Hudson-Doyle 34acb8e7da
Merge pull request #790 from mwhudson/datasource-None
use the "None" datasource for on-first-boot configuration
2020-06-16 14:14:45 +12:00
Michael Hudson-Doyle bbfcdd7b25 sort installer cloud config after 90_dpkg.cfg 2020-06-16 13:55:30 +12:00
Dirk Weise 33e16fbbe5 Add disk size match smallest 2020-06-15 21:01:42 +02:00
Michael Hudson-Doyle 74c26447bc
Merge pull request #777 from mwhudson/better-esp-detection
Better esp detection
2020-06-15 16:06:56 +12:00
Michael Hudson-Doyle d9d57e53a0 be a bit more defensive 2020-06-15 15:53:11 +12:00
Michael Hudson-Doyle 2a3afa5c19 use any() instead of a for loop in a few places
suggested in review
2020-06-15 15:36:29 +12:00
Michael Hudson-Doyle 820315e02c look at the typecode to detect an ESP on MBR 2020-06-15 15:32:42 +12:00
Michael Hudson-Doyle f0661f39b9 add a property to tell if a partition is an ESP
the only change in behaviour is that you can now delete bootloader
partitions that apply to the booted system.
2020-06-15 15:32:42 +12:00
Michael Hudson-Doyle 2ddde49a43 use the "None" datasource for on-first-boot configuration
Using the NoCloud source meant that a filesystem label of "cidata"
(probably containing autoinstall config) could override the cloud-init
nocloud seed subiquity wrote and then users would not get created. So
instead write cloud config directly that hardcodes using the
DataSourceNone source and config for it.

https://bugs.launchpad.net/subiquity/+bug/1879103
2020-06-15 15:07:03 +12:00
Michael Hudson-Doyle cfb31695cf allow starting a shell when connecting to a session running an autoinstall 2020-06-12 15:35:59 +12:00
Michael Hudson-Doyle 5016f228f7 catch errors raised by checking for a snap update
I am not sure when I dropped this :(
2020-06-12 14:44:36 +12:00
Michael Hudson-Doyle 5f3e79f8c6 fix crash on opening a help topic when a help topic is already open 2020-06-12 13:12:31 +12:00
Michael Hudson-Doyle 6b99a1c399
Merge pull request #784 from PuffyZA/patch-1
Fix incorrect key in user_info
2020-06-12 11:27:47 +12:00
Michael Hudson-Doyle cad2dd4e5f handle move of get_architecture from curtin.util to curtin.distro 2020-06-12 09:35:35 +12:00
Puffy eb9547b3a9
Fix incorrect key in user_info
The key lock-passwd in the user_info is incorrect, should be lock_passwd.
2020-06-09 16:45:17 +02:00
Michael Hudson-Doyle a16b017f32 Merge branch 'master' into better-language-lists 2020-05-21 14:11:50 +12:00
Michael Hudson-Doyle 9a779f40c2
Merge pull request #780 from mwhudson/rich-mode-cleanups
make it easier to open a help topic
2020-05-21 14:11:06 +12:00
Michael Hudson-Doyle afe22f2982 Merge branch 'master' into better-language-lists 2020-05-21 12:40:28 +12:00
Michael Hudson-Doyle a9dd3757f1
Merge pull request #761 from mwhudson/still-better-i18n
more work towards being able to provide good translations
2020-05-21 12:38:51 +12:00
Michael Hudson-Doyle 317121ab41 make it easier to open a help topic
meant to do this before landing my recent branch
2020-05-21 12:23:22 +12:00
Michael Hudson-Doyle 07d8f046b7 Merge branch 'master' into better-language-lists 2020-05-21 12:08:32 +12:00
Michael Hudson-Doyle 3e881df107
Merge pull request #778 from mwhudson/ascii-toggle
start in a super basic mode on serial, offer upgrade immediately
2020-05-21 12:05:47 +12:00
Michael Hudson-Doyle 05bbdb4ac9 fix mis-merge 2020-05-21 12:04:29 +12:00
Dimitri John Ledkov e2fe2a0693
Merge pull request #773 from xnox/snap-create-user-error
console_conf: fix showing error messages, when snap create-user fails
2020-05-21 01:02:31 +01:00
Michael Hudson-Doyle 35f1d511a6 fix some silly mistakes 2020-05-21 11:54:49 +12:00
Michael Hudson-Doyle 0216f1c6fc advertize that SSH gets you more languages 2020-05-21 11:54:49 +12:00
Michael Hudson-Doyle 5b1c40817b read languages from language list 2020-05-21 11:54:49 +12:00
Michael Hudson-Doyle 25e2c8c504 fix tests 2020-05-21 11:41:16 +12:00
Michael Hudson-Doyle b1a67f797c tweak title 2020-05-21 11:41:16 +12:00
Michael Hudson-Doyle 9eb625dd03 offer ssh instructions on the initial screen on serial 2020-05-21 11:41:16 +12:00
Michael Hudson-Doyle 0950bf843e explain basic mode on initial screen 2020-05-21 11:41:16 +12:00
Michael Hudson-Doyle 0d267b320e only allow downgrading color/ascii experience on serial
and collapse ascii/color choice to a single 'rich' toggle
2020-05-21 11:41:16 +12:00
Michael Hudson-Doyle 7bcfcba99b Merge branch 'master' into still-better-i18n 2020-05-21 11:15:32 +12:00
Michael Hudson-Doyle fec0cfa094 call setlocale() and set LC_CTYPE to C.UTF-8 if it fails 2020-05-21 10:48:53 +12:00
Dimitri John Ledkov 6de8970560 console_conf: fix showing error messages, when snap create-user fails 2020-05-18 12:42:14 +01:00
Michael Hudson-Doyle 2ea7f6cd5a
Merge pull request #769 from idryzhov/fix-version
write version into autoinstall-user-data
2020-05-15 08:09:56 +12:00
Michael Hudson-Doyle 0ef70d4ba8
Merge pull request #768 from idryzhov/fix-keyboard
allow keyboard/toggle to be null
2020-05-15 08:09:09 +12:00