Commit Graph

648 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 53d1006a06 Make the code for talking to snapd more generic
In preparation for the self-refresh and snap enterprise proxy work, both
of which will require talking to the snapd API.

This also makes the "snaps-from-examples" fakery happen at a lower level.
2019-03-04 16:18:57 +13:00
Michael Hudson-Doyle 3b4d7a4266 move snap title into header 2019-02-27 15:56:02 +13:00
Michael Hudson-Doyle 2587b6dd02 fix some dodgy algebra in scrollbars 2019-02-27 14:28:05 +13:00
Michael Hudson-Doyle b77aa9499e make sure all delays during replaying answers repsect SUBIQUITY_REPLAY_TIMESCALE 2019-02-21 11:07:54 +01:00
Michael Hudson-Doyle bc755cc953 fix a race condition in network answers support 2019-02-21 09:32:45 +01:00
Michael Hudson-Doyle c571f58dcc fix saving static network data with search domains 2019-02-21 08:35:19 +01:00
Michael Hudson-Doyle f25bb21c08 fix netdev info dialog 2019-02-19 14:40:19 +01:00
Michael Hudson-Doyle f4cf947b0a center the list of disks 2019-02-04 17:41:11 +13:00
Michael Hudson-Doyle fae9be9103 make the network view slightly less of a snowflake 2019-02-04 17:25:31 +13:00
Michael Hudson-Doyle 0b3d44f911 oops 2019-02-04 16:17:58 +13:00
Michael Hudson-Doyle 4e0af495df more 2019-02-04 14:47:00 +13:00
Michael Hudson-Doyle a553246a30 add a min_width of 96 to the content area of the "standard" view 2019-02-04 14:43:19 +13:00
Michael Hudson-Doyle aebb0b2e2e fill identity fields if you go back to that form 2018-12-13 14:49:55 +13:00
Michael Hudson-Doyle 2eb9420a75 move ssh key fetching over to ssh view 2018-12-13 14:15:43 +13:00
Michael Hudson-Doyle 16a853107e add form fields to ssh view 2018-12-13 14:15:43 +13:00
Dimitri John Ledkov 0d35fa613c core: special case s390x vt220 console on /dev/ttysclp0, as it supports colors. 2018-11-23 01:24:34 +00:00
Michael Hudson-Doyle bee1109a2d Much more fine grained answers support for networking. 2018-10-31 09:59:31 +13:00
Michael Hudson-Doyle 5f8e3dc2a4 do not call next-screen from a background thread 2018-10-31 09:58:58 +13:00
Michael Hudson-Doyle 09bbe3ff19 Do not call the default route waiter repeatedly.
This can crash when multiple interfaces get routes.
2018-10-31 09:58:58 +13:00
Michael Hudson-Doyle 15b6bb1114 Major refactor of network model
The main thrust of this is to not create virtual interfaces until
applying the config.

This meant that the network model has to change a bit to be able to
represent interfaces that do not yet exist on the system. I did this
by ripping out most of the existing network device code: now a
NetworkDev is really just a wrapper for the config for a device and (if
it exists) the netlink data too. A few places had to adjust to checking
if the netlink info is available before accessing it but all in all it
was not that painful.

There are a few other refactorings in this commit that perhaps should be
split out (how the bond parameters are handled, some stuff about
resizing the table rows when interfaces are edited) but it doesn't
really seem worth it.
2018-10-31 09:58:56 +13:00
Michael Hudson-Doyle 7a86603539 prevent bonding of bonds
https://bugs.launchpad.net/bugs/1782397
2018-07-23 10:39:14 +12:00
Michael Hudson-Doyle 96ee3db409 make example CIDR form address family appropriate
https://bugs.launchpad.net/bugs/1782391
2018-07-23 10:38:06 +12:00
Michael Hudson-Doyle 7f766e93a1 forbid bonding of vlans
https://bugs.launchpad.net/bugs/1782351
2018-07-23 10:34:41 +12:00
Michael Hudson-Doyle 42b339605c make button labels more consistent
especially back vs cancel

for https://bugs.launchpad.net/subiquity/+bug/1781457
2018-07-16 22:45:36 +12:00
Michael Hudson-Doyle d95f089a04 add arrows at end of scrollbar
for https://bugs.launchpad.net/subiquity/+bug/1781460
2018-07-16 12:44:38 +12:00
Michael Hudson-Doyle 53fb81a65b correctly call wrapped lost_focus in _Validator.lost_focus
fixes https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1781429
2018-07-16 12:44:38 +12:00
Michael Hudson-Doyle f19a453e0e mark interfaces that have dhcp enabled but did not get an address as optional 2018-07-12 14:17:20 +12:00
Michael Hudson-Doyle 437f42b599 lint 2018-07-12 11:36:30 +12:00
Michael Hudson-Doyle f3b0d13fbe a proper multi-nic selector 2018-07-12 10:10:08 +12:00
Michael Hudson-Doyle 07ac05b6d3 view improvements 2018-07-11 22:02:52 +12:00
Michael Hudson-Doyle 46c0d598ad first cut at a bond form that handles devices too 2018-07-11 22:02:52 +12:00
Michael Hudson-Doyle 5e683dcc1f add create bond button 2018-07-11 22:02:52 +12:00
Michael Hudson-Doyle 2f149a8aac enable/disable bond options as bonding mode changes 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov 87558f0074 lint 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov 88b64ca7fd Fix up bond netplan. 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov 87ef3749e6 Finish bond master/slaves. 2018-07-11 22:02:52 +12:00
Dimitri John Ledkov e0d231f5d7 Create bond 2018-07-11 22:02:52 +12:00
Michael Hudson-Doyle 0457985208 fixup tests 2018-07-11 14:55:41 +12:00
Michael Hudson-Doyle 535a0f3b04 fix editing an interface 2018-07-11 09:43:58 +12:00
Michael Hudson-Doyle c21cec6fdc fix logic around waiting for udev to settle to avoid busy loop 2018-07-11 09:41:56 +12:00
Michael Hudson-Doyle e91308e8b9 close any dialog open for an interface that is deleted 2018-07-11 09:36:14 +12:00
Michael Hudson-Doyle c69b89b4df expand a whinge about urwid's focus behaviour 2018-07-11 09:35:01 +12:00
Michael Hudson-Doyle 91def10468 improve message on vlan interfaces 2018-07-10 22:58:47 +12:00
Michael Hudson-Doyle 53a14e30ad make updates to network screen in response to netlink events more finegrained 2018-07-10 13:25:05 +12:00
Michael Hudson-Doyle 1701246d12 refactor how device row gets created a bit 2018-07-10 12:34:42 +12:00
Michael Hudson-Doyle b3636cfcd9 refactor how netdev action menu gets populated 2018-07-10 12:30:01 +12:00
Michael Hudson-Doyle db042eafa6 read vlan config from netlink
using support i just added to probert
2018-07-08 14:16:22 +12:00
Dimitri John Ledkov 8a0e94ccc7 Pacify flake8 2018-07-06 15:00:27 +01:00
Dimitri John Ledkov a4daae42d6 Fix crash, after deleting last vlan. 2018-07-06 14:33:34 +01:00
Dimitri John Ledkov 68b6b2a6b1 Implement information screen for the network interfaces. 2018-07-06 14:33:32 +01:00
Dimitri John Ledkov 92c53b29ae Vlan ui 2018-07-06 14:31:42 +01:00
Dimitri John Ledkov 173eac79a5 models/network: use same NetDev in both dictionaries
One can lookup interfaces by ifindex and by name. Ensure, both
dictionaries use the same NetDev object. This way, when config of
NetDev is updated, it is correctly reflected whichever way the NetDev
is accessed.
2018-07-06 14:30:42 +01:00
Michael Hudson-Doyle d5f136c413 improve behaviour when a spanning column makes table want to be wider than view 2018-07-06 15:20:25 +12:00
Michael Hudson-Doyle e3e5c7f760 fix tests 2018-07-06 14:44:19 +12:00
Michael Hudson-Doyle ed09054928 fix lint 2018-07-06 14:17:27 +12:00
Michael Hudson-Doyle 29fe577013 delete more unused code 2018-07-06 14:13:30 +12:00
Michael Hudson-Doyle 830d89c735 unify "action menu row" creation 2018-07-06 13:57:55 +12:00
Michael Hudson-Doyle 7d15727b74 add wlan editing 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 2e281d00d4 delete gobs of old code 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 2251cac4ba trim back to existing functionality 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 805ad5f495 code motion 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 79a380f28f initialize manual form fields 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 58fd656aed small tweaks 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 834b5a1014 a bit better 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 89a30721a2 copy network manager a bit more directly 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 0fdd9721ce tweaks 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 08de48623f more 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 4c9ec9cf5e more 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 6eb255c2e0 beginnings of an edit network device dialog 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle ad8d6c9086 skeleton of new view 2018-07-06 13:36:53 +12:00
Michael Hudson-Doyle 7aac188a4b grey out the background widget when an overlay is showing 2018-07-04 15:53:47 +12:00
Michael Hudson-Doyle e0eeeadd28 enable/disable a Toggleable via a property not methods 2018-07-04 11:47:44 +12:00
Michael Hudson-Doyle 38eccb8382 use the new variable table padding on filesystem views 2018-06-29 14:00:22 +12:00
Michael Hudson-Doyle 5e621a4780 allow for variable spacing between table columns 2018-06-29 13:40:58 +12:00
Michael Hudson-Doyle dbe07faa5c fix infinite loop in table width calculations 2018-06-29 09:24:12 +12:00
Michael Hudson-Doyle 91247c82c5
Merge pull request #373 from mwhudson/raid-the-fourth
Raid the fourth
2018-06-27 11:06:43 +12:00
Michael Hudson-Doyle 237290bbb3 fix rendering of long labels on guided disk selection screen 2018-06-26 14:20:41 +12:00
Michael Hudson-Doyle 9e4a66b628 add the raid view 2018-06-26 12:22:09 +12:00
Michael Hudson-Doyle edd6769a60 add ReadOnlyField (to be used for the size of a raid) 2018-06-26 12:19:47 +12:00
Michael Hudson-Doyle 1895d98ac4 tweak TableRow.selectable 2018-06-26 11:40:02 +12:00
Michael Hudson-Doyle 48666547f1 convert focusable things on filesystem view to "[ {stuff} ▸ ]" layout 2018-06-26 11:14:37 +12:00
Michael Hudson-Doyle 237611fda6 change " menu >" to "[ menu ▸ ]" 2018-06-26 10:19:57 +12:00
Michael Hudson-Doyle 1ae09926ca change button_pile to use widget_width 2018-06-26 10:12:09 +12:00
Michael Hudson-Doyle 8854e7aaaa move CursorOverride somewhere generic 2018-06-26 10:05:37 +12:00
Michael Hudson-Doyle 22ae45e99b move widget_width() to its own module
also allow our widget subclasses to specify their width
2018-06-26 09:59:48 +12:00
Michael Hudson-Doyle 5f3ce077ac
Merge pull request #372 from mwhudson/selector-tweaks
Selector tweaks
2018-06-26 09:10:46 +12:00
Michael Hudson-Doyle 8bb5621947
Merge pull request #371 from mwhudson/action-menu-tweaks
do not show > in the context menu for actions that do not open a dialog
2018-06-25 23:50:24 +12:00
Michael Hudson-Doyle 4501aee357 rework look of open selector to match 2018-06-25 23:45:21 +12:00
Michael Hudson-Doyle 391b70cdf5 rework the look of the selector widget 2018-06-25 23:45:21 +12:00
Michael Hudson-Doyle 7ab699716d make Selector.options a public interface 2018-06-25 23:45:21 +12:00
Michael Hudson-Doyle 80bec75871 stop assigning to Selector.value emitting the "select" signal
for the avoidance of infinite recursion
2018-06-25 23:45:21 +12:00
Michael Hudson-Doyle f08b6a42e5 make selector a WidgetWrap rather than a decoration 2018-06-25 23:10:39 +12:00
Michael Hudson-Doyle a6f54be22a fix stupid failure of arithmetic in stretchy 2018-06-25 22:57:57 +12:00
Michael Hudson-Doyle 8b9331e5be do not show > in the context menu for actions that do not open a dialog 2018-06-25 22:52:34 +12:00
Michael Hudson-Doyle 90d580a57e remove DummyView 2018-06-22 09:39:33 +12:00
Michael Hudson-Doyle 9cbaac4542 use our custom WidgetWrap everywhere 2018-06-22 09:38:18 +12:00
Michael Hudson-Doyle ea8f97491f delete old ErrorView 2018-06-22 09:34:02 +12:00
Michael Hudson-Doyle 0e2d376ed0 build a form out of tables 2018-06-21 21:07:02 +12:00
Michael Hudson-Doyle 7093006711 fix binding more than two tables 2018-06-21 20:48:08 +12:00
Michael Hudson-Doyle 88e23fce54 fix distribution of space when widening columns to accommodate a colspan>1 column 2018-06-21 16:07:00 +12:00
Michael Hudson-Doyle f09696862a add a column option to allow a column to take available space 2018-06-21 16:07:00 +12:00
Michael Hudson-Doyle 8eb21bce72 split Table into TablePile and TableListBox
and get rid of that confusing container_maker thing
2018-06-21 16:07:00 +12:00
Michael Hudson-Doyle 119f40b72d
Merge pull request #369 from mwhudson/form-simplify
simplify the way forms are turned into widgets
2018-06-21 16:06:47 +12:00
Michael Hudson-Doyle f037ebd586 add lost_focus/gained_focus to our WidgetWrap 2018-06-21 15:39:14 +12:00
Michael Hudson-Doyle 99dd12f870 simplify how forms are built 2018-06-21 15:38:02 +12:00
Michael Hudson-Doyle ed86028dd2 provide a way for a field to opt out of default styling 2018-06-21 15:37:19 +12:00
Michael Hudson-Doyle 19d43c19c7 make field an ABC 2018-06-21 15:37:19 +12:00
Michael Hudson-Doyle ba809a9e97 simplify how form widgets get styled 2018-06-21 15:37:19 +12:00
Michael Hudson-Doyle 59da0e717b make Toggleable simpler and more robust 2018-06-21 15:37:15 +12:00
Michael Hudson-Doyle eee758d382 update STYLE_NAMES to match the styles that are currently defined 2018-06-21 12:09:40 +12:00
Michael Hudson-Doyle 76835c40ab sort STYLE_NAMES constructor 2018-06-21 12:09:40 +12:00
Michael Hudson-Doyle 8680786da3 make inputs on keyboard and welcome page of consistent width 2018-06-20 09:17:49 +12:00
Michael Hudson-Doyle 9e33874a86
Merge pull request #366 from mwhudson/mwhudson/scrollbar-tweaks
make scrollbar less intrusive
2018-06-20 08:47:56 +12:00
Michael Hudson-Doyle 68c49e5135 add some super basic filesystem tests, fix partition tests 2018-06-19 11:43:59 +12:00
Michael Hudson-Doyle de80a06f47 add actionmenu widget 2018-06-18 21:36:35 +12:00
Michael Hudson-Doyle c0d66f5540 make scrollbar less intrusive
also pretty up its implementation a bit while I am here
2018-06-18 21:24:23 +12:00
Michael Hudson-Doyle 14ad092b9d implement _select_first/last_selectable on our Columns 2018-06-15 12:26:02 +12:00
Michael Hudson-Doyle 3a59925265 work around a strange behaviour of Pile when contents is changed 2018-06-15 11:51:40 +12:00
Michael Hudson-Doyle 66578aff79 account for colspan>1 cells in width computations
I ran into that gotcha pretty quickly.
2018-06-15 11:48:19 +12:00
Michael Hudson-Doyle b34ca65aba a slightly over-engineered table widget
that takes column widths from the contens of the cells, unlike
most things in urwid
2018-06-15 11:48:19 +12:00
Michael Hudson-Doyle 2f184ce9a6 fix display of install progress in footer 2018-06-13 14:02:40 +12:00
Michael Hudson-Doyle 1ab495c0a8 fix refreshing network view on network changes 2018-06-13 13:38:03 +12:00
Michael Hudson-Doyle d315751d60 add our own version of WidgetWrap
urwid doesn't know about the _select_first/last_selectable methods our
containers use to make tab-cycling work so its WidgetWrap doesn't
forward them along. So add a WidgetWrap that does, and use it in the one
place that it matters so far (more coming soon!).
2018-06-11 14:13:44 +12:00
Scott Moser 3e69673501 Fix writing of netplan configs
When user configures network with subiquity, it's rendered
netplan should be wholly definitive.  So, we remove the other files
that may have config.  This fixes a bug where running in an instance
when running on a system where cloud-init had rendered a 'match' with
'macaddress'.

When writing netplan we keep 'macaddress' match in place but drop
others.  The others may just wildcard from the installer environment,
but macaddress are likely by cloud-init or otherwise intentionally
written.

Also add an atomic write in subiquitycore/file_util and move the
netplan code into subiquitycore/netplan.py, and add some unit test
helpers from cloud-init.
2018-06-07 11:46:34 -04:00
Michael Hudson-Doyle 270ba0992a fix selectability in non-scrolling stretchy 2018-06-07 12:50:50 +12:00
Scott Moser 51a7169904 tox: Support running tests and flake8 in tox.
This puts into place a tox.ini for running unit tests without
a large amount of deps installed into the system. For example,
we did not want to need libnl-route-3-dev or build-essential installed
in the system in order to run unit tests.

In order avoid import errors in the modules due to these missing
dependencies, we have added a 'fake_deps/' directory that provides
mock'd objects of the dependencies that were used.

The only installed packages necessary for this to run should be
tox itself and its dependencies (pip and friends).  From a clean new
container we can then do:
  apt-get install tox
  git clone ...
  tox

Also along the way:
 * adjust setup.py to only need the DistUtilsExtra during 'build'.
   This means tox usage doesn't require python3-distutils-extra.
 * drop use of lsb_release in favor of built-in parsing.
   This python module wasn't doing much.  We can parse /etc/lsb-release
   ourselves with less footprint.  Also part of the motivation for this
   is that lsb_release was not on pypi.
 * replace use of StorageInfo in test_partition.py with a FakeStorageInfo
 * .gitignore: ignore only the top level 'probert' directory so that
   we can track fake_deps/probert.
 * fix a couple escape chars, by using raw strings (r'').
 * adjust gettext to return un-modified strings rather than '_(string)',
   but support old style if FAKE_TRANSLATE=mangle.
2018-06-05 17:59:46 -04:00
Michael Hudson-Doyle eab0f668ff use general machinery a little more 2018-05-31 10:28:29 +12:00
Michael Hudson-Doyle ed5e1d86b5 fix lint 2018-05-25 10:43:55 +12:00
Ryan Harper 053a1c249d pyflakes3 fixes for subiquitycore/__init__.py 2018-05-24 16:59:31 -05:00
Ryan Harper d7c8b1111b pep8 fixes for subiquitycore/core.py 2018-05-24 16:59:31 -05:00
Ryan Harper d293c52152 pep8 fixes for subiquitycore/tasksequence.py 2018-05-24 16:59:31 -05:00
Ryan Harper 4c1b6e6fc9 pep8 fixes for subiquitycore/ui/buttons.py 2018-05-24 16:59:31 -05:00
Ryan Harper 080ac4c245 pep8 fixes for subiquitycore/ui/form.py 2018-05-24 16:59:31 -05:00
Ryan Harper 5b666294e5 pep8 fixes for subiquitycore/ui/utils.py 2018-05-24 16:59:31 -05:00
Ryan Harper 7dba257b3c Drop mis-merged code from rebase 2018-05-24 16:59:31 -05:00
Ryan Harper 09d7398ec6 pep8 fixes for subiquitycore/__init__.py 2018-05-24 16:54:02 -05:00
Ryan Harper 5f233be9b1 pep8 fixes for subiquitycore/ui/views/network.py 2018-05-24 16:54:02 -05:00
Ryan Harper c908115ee0 pep8 fixes for subiquitycore/ui/views/network_configure_manual_interface.py 2018-05-24 16:54:02 -05:00
Ryan Harper c4c614860a pep8 fix drop commented code in subiquitycore/controllers/network.py 2018-05-24 16:54:02 -05:00
Ryan Harper 5660d72cf1 pep8 fixes for subiquitycore/controller.py 2018-05-24 16:51:51 -05:00
Ryan Harper 9159cd0003 pep8 fixes for subiquitycore/core.py 2018-05-24 16:51:51 -05:00
Ryan Harper dcc0cbc240 pep8 fixes for subiquitycore/i18n.py 2018-05-24 16:51:51 -05:00
Ryan Harper 02cbd2948c pep8 fixes for subiquitycore/prober.py 2018-05-24 16:51:51 -05:00
Ryan Harper bad0e9761f pep8 fixes for subiquitycore/tasksequence.py 2018-05-24 16:51:51 -05:00
Ryan Harper b328c3deed pep8 fixes for subiquitycore/utils.py 2018-05-24 16:51:51 -05:00
Ryan Harper cfc2c9d227 pep8 fixes for subiquitycore/view.py 2018-05-24 16:51:51 -05:00
Ryan Harper 69331754d9 pep8 fixes for subiquitycore/ui/anchors.py 2018-05-24 16:51:51 -05:00
Ryan Harper df5ff9d48e pep8 fixes for subiquitycore/ui/buttons.py 2018-05-24 16:51:51 -05:00
Ryan Harper 860edbc7b5 pep8 fixes for subiquitycore/ui/container.py 2018-05-24 16:51:51 -05:00
Ryan Harper 2d6cca8281 pep8 fixes for subiquitycore/ui/frame.py 2018-05-24 16:51:51 -05:00