Commit Graph

3969 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 5b7409750e
Merge pull request #964 from mwhudson/network-error-reports
handle some networking errors better
2021-06-02 13:44:26 +12:00
Michael Hudson-Doyle 8848db87cd change log.error to log.exception when handling a network subsriber call failing 2021-06-02 13:23:44 +12:00
Michael Hudson-Doyle 65a3290a7d add wlan-related methods to API
nothing will call these yet because we are still hiding wlan nics in the
model but it is all simple enough
2021-06-02 13:18:18 +12:00
Michael Hudson-Doyle 6aaa0b70d9
Merge pull request #962 from mwhudson/fs-action-reorg
move DeviceAction stuff to its own file
2021-06-02 13:15:16 +12:00
Michael Hudson-Doyle 1e294a9915 do not crash the server when a call to a network subscriber fails 2021-06-02 13:09:14 +12:00
Michael Hudson-Doyle 4dd7922a80 generate an error report when a network subscription handler fails 2021-06-02 13:09:14 +12:00
Michael Hudson-Doyle c1e9b0a2d7 fix call to make_apport_report on apply_config failure 2021-06-02 13:09:14 +12:00
Michael Hudson-Doyle 47b2836aee pretend virtual wlan (i.e. mac80211_hwsim) devices are real
this allows their use for testing
2021-06-02 12:40:57 +12:00
Michael Hudson-Doyle d14fd35330 move "enabling wifi turns on dhcp4" behaviour to controller from view 2021-06-02 12:40:50 +12:00
Michael Hudson-Doyle 902c57f7f7 move start_scan error handling into controller
report errors via scan_state field
2021-06-02 12:28:44 +12:00
Michael Hudson-Doyle b84fa27752 call apply_config in controller set_wlan method 2021-06-02 12:28:44 +12:00
Michael Hudson-Doyle b046608a78 fix type annotations in network model types 2021-06-02 12:28:44 +12:00
Michael Hudson-Doyle 4850cee5ce NetworkConfigureWLANStretchy.update_link should only care about updates for its nic
this was very confusing to debug!
2021-06-02 12:28:44 +12:00
Michael Hudson-Doyle c325e76e9e fix the wlan view calls to controller methods to pass just the nic name 2021-06-02 12:28:42 +12:00
Michael Hudson-Doyle 7726c14d87 move action tests 2021-05-31 22:59:59 +12:00
Michael Hudson-Doyle b3e124d26f convert all "is this action possible on this device" code over to new style 2021-05-31 22:59:59 +12:00
Michael Hudson-Doyle 22bf1a0321 light refactor 2021-05-31 22:59:59 +12:00
Michael Hudson-Doyle a3588e8fa9 migrate can_EDIT functionality 2021-05-31 22:59:59 +12:00
Michael Hudson-Doyle 997897fa51 convert supported_actions method into a functools.singledispatch 2021-05-31 22:59:59 +12:00
Michael Hudson-Doyle d75af226a5 make subiquity.common.filesystem into a package 2021-05-31 22:59:59 +12:00
Marcus Tomlinson d444177932
Create socket directory from dirname not basename (#961) 2021-05-26 14:57:28 -06:00
Dan Bungert f27c424c8d
Open the permissions on the socket (#959)
* Open the permissions on the socket

Installer clients can be non-root.
Installer clients run in an environment where root is just a
password-less sudo away.

* Same permissions on the other socket also
2021-05-25 18:04:36 -06:00
Dan Bungert 657f27ebf9
Rearrange makefile targets (#960)
Skip a recursive make step and simplify a bit.
Add dryrun-server.
Also an unrelated whitespace fix.
2021-05-25 16:59:22 -06:00
Michael Hudson-Doyle 63fc286644
Merge pull request #958 from mwhudson/lp-1929129
do not crash in server start up if cloud-init is not running
2021-05-21 10:21:21 +12:00
Michael Hudson-Doyle 77576714ff do not crash in server start up if cloud-init is not running
such as desktop (for now) and bionic (oops)
2021-05-21 09:52:56 +12:00
Dan Bungert f1c7c17c19
Don't redundantly remove from the overlay list (#957)
There are two places that remove from this list, and the current arm64
crash is running into a scenario where we try to remove from the
overlays list only to find that it's not actually there.
So don't remove if it's already gone.
2021-05-19 20:18:56 -06:00
Dan Bungert 4f9de12556
Split unit / integration tests a bit (#956)
Unit tests should be quick and run frequently.
Integration tests can be longer and run less often.
Split them up.
2021-05-17 07:31:29 -06:00
Michael Hudson-Doyle 3cbcddb651
Merge pull request #954 from mwhudson/no-apport-hooks-in-dry-run-mode
do not run most apport hooks in dry-run mode
2021-05-14 04:31:14 +12:00
Michael Hudson-Doyle 77343cb160 do not run most apport hooks in dry-run mode
they are slow and can hang in CI
2021-05-14 04:27:25 +12:00
Michael Hudson-Doyle 0de5aec333
Merge pull request #950 from mwhudson/shell-on-autoinstall-fail
offer to run a shell after an autoinstall fails
2021-05-13 10:26:15 +12:00
Dan Bungert d04b6a9a3e
dryrun: use the simple machine config (#952)
`make dryrun` will now use the simple sample machine config instead of
probing local hardware.   That local probe only seems to be viable
anyhow if we're running as root, and that's vulnerable to real problems
if dryrun is less than 100% insulated from making real machine changes.
2021-05-12 16:23:58 -06:00
Michael Hudson-Doyle fcc542d436
Merge pull request #953 from mwhudson/traceback-in-response
include the traceback in the response when a server method fails
2021-05-13 07:00:01 +12:00
Michael Hudson-Doyle 7a6a984578 add a bit in DESIGN.md about how errors work in the API 2021-05-13 06:17:33 +12:00
Michael Hudson-Doyle f339620a50 include the traceback in the response when a server method fails
example:

$ curl  --unix-socket .subiquity/socket a/dry_run/crash
Traceback (most recent call last):
  File "/home/mwhudson/src/subiquity/subiquity/common/api/server.py", line 122, in handler
    result = await implementation(**args)
  File "/home/mwhudson/src/subiquity/subiquity/server/dryrun.py", line 24, in crash_GET
    1/0
ZeroDivisionError: division by zero
2021-05-13 05:44:47 +12:00
Michael Hudson-Doyle 03d6118e82
Merge pull request #951 from mwhudson/lp-1927103
decide whether to let curtin create a swapfile when rendering config
2021-05-13 05:38:22 +12:00
Michael Hudson-Doyle 0ecccecee6 decide whether to let curtin create a swapfile when rendering config
https://bugs.launchpad.net/subiquity/+bug/1927103 reports a regression
where a subiquity-installed system has a swapfile even if a swap
partition has been explicitly configured.

The reason this broke is that previously subiquity tracked whether a
swap file should be allowed or not by keeping track of whether a swap
partition was mounted in add_mount / remove_mount. But since the
client/server split, those methods aren't called in the server process
any more.

Just get rid of all the cleverness and call _should_add_swapfile when
rendering the curtin config.
2021-05-11 11:02:33 +12:00
Michael Hudson-Doyle 75c71b9d85 offer to run a shell after an autoinstall fails
otherwise, especially on a serial console, there is not really any way
to debug what is going on.

also, when non-interactive defer setting the applicationstate to ERROR
until the information in the error report has been collected and the
error-commands have run.
2021-05-10 14:30:39 +12:00
Michael Hudson-Doyle 541b483fb9
Merge pull request #947 from mwhudson/lp-1926616
mark the locale model as configured at start up
2021-05-09 22:41:58 +12:00
Dimitri John Ledkov dabd3198be
Merge pull request #948 from mwhudson/no-trusted=yes
verify signatures on the cdrom pool again
2021-05-05 09:51:57 +01:00
Michael Hudson-Doyle 32641489bd verify signatures on the cdrom pool again
It's not safe in the netboot case.
2021-05-05 09:51:30 +12:00
Michael Hudson-Doyle 1da1ead19c add a integation test for non-rich mode 2021-05-04 12:44:41 +12:00
Michael Hudson-Doyle 447e192fee mark the locale model as configured at start up
The subiquity client does not ask about language in non-rich mode on a
serial port, and that's OK. But we still need the install to complete :)

There are other ways to fix this I guess -- we could not wait on the
locale model to get configured, for example, or explicitly select a
C.UTF-8 locale when "Continue in basic mode" is selected, or probably
some other things. But this works and seems OK.
2021-05-04 12:22:38 +12:00
Michael Hudson-Doyle f91d84eb26
Merge pull request #946 from mwhudson/trust-cdrom
set trusted=yes,check-date=no for cdrom pool during installation
2021-05-04 10:40:27 +12:00
Michael Hudson-Doyle d617445190
Merge pull request #945 from mwhudson/lp-1926132
fix crash on network apply failure
2021-05-04 10:39:42 +12:00
Michael Hudson-Doyle 3a0c04500f
Merge pull request #944 from mwhudson/fix-logging-unconfigured-models
fix logging unconfigured models
2021-05-04 10:39:26 +12:00
Michael Hudson-Doyle f0a230ceff
Merge pull request #943 from mwhudson/lp-1898583
have console-conf-write-login-details exit with code 2 when no IPs found
2021-05-04 10:38:04 +12:00
Michael Hudson-Doyle 29676d8c22 set trusted=yes,check-date=no for cdrom pool during installation
The pool is loaded off the same media as the installer and the
filesystem being installed so there's no real loss of security doing
this and it makes it easier for people to master custom ISOs with extra
packages in the pool and systems with inaccurate clocks (that cannot
reach ntp.ubuntu.com).
2021-05-03 13:25:30 +12:00
Michael Hudson-Doyle d31a150f06 fix crash on network apply failure
https://bugs.launchpad.net/subiquity/+bug/1926132
2021-05-03 11:40:49 +12:00
Michael Hudson-Doyle 7465e2ccb2 fix logging unconfigured models
debugging Launchpad bug 1926616 would have been much easier if this was
working!
2021-05-03 11:18:09 +12:00
Michael Hudson-Doyle 6a9d100b64 have console-conf-write-login-details exit with code 2 when no IPs found
Also make the log files resulting from console-conf-write-login-details
execution a bit easier to spot.
2021-05-03 11:04:03 +12:00