Commit Graph

1941 Commits

Author SHA1 Message Date
Michael Hudson-Doyle ad17c530b0 only add the user to groups that exist in the target system
for https://bugs.launchpad.net/subiquity/+bug/1775228
("user is in debian-tor group on fresh install")
2018-06-14 15:27:06 +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 9ef56239f8 fix snap build
* use a different way to avoid depending on i18n in tox
 * add __init__.py files to new packages
2018-06-13 13:21:20 +12:00
Łukasz 'sil2100' Zemczak d5413fde2d Zyga is right - better to check the ID instead of NAME. 2018-06-12 17:14:37 +02:00
Michael Hudson-Doyle c9e87438ae
Merge pull request #361 from mwhudson/better-WidgetWrap
add our own version of WidgetWrap
2018-06-12 09:04:06 +12:00
Łukasz 'sil2100' Zemczak 75bdbab36b Whoops, it was a real failure reported by flake8 - fix missing bracket. 2018-06-11 13:22:39 +02:00
Łukasz 'sil2100' Zemczak 32b724e608 Forgot the version string in one template. 2018-06-11 13:17:30 +02: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
Michael Hudson-Doyle 29d21c2a57
Merge pull request #359 from smoser/fix/spaces-in-events-json
Fix curtin block comments in example events.
2018-06-11 12:26:26 +12:00
Łukasz 'sil2100' Zemczak 17c6358320 console-conf identity: Reuse the login_details_tmpl_no_ip template in standalone, use os-release to determine the Ubuntu Core version as we now support both 16 and 18. 2018-06-08 21:21:02 +02:00
Scott Moser 777610572b
Add a mirror panel.
This very simply adds a mirror panel to subiquity.
Nothing intelligent at all.  Just defaults to filling with
http://archive.ubuntu.com/ubuntu/ and lets user fill it in.

As implemented here, the mirror only replaces primary mirror,
security will still use http://security.ubuntu.com/ubuntu/
2018-06-08 12:21:28 -04:00
Scott Moser b82f90f7b1 Fix curtin block comments in example events.
I fixed the 'c u r t i n  b l o c k'... report event in the code a few
commits back, but when using dry-run it was still present because
dry run uses the events json rather than real curtin output.

This just updates the events json to be in line with reality as
it was confusing to see it in the dry run path.
2018-06-08 10:54:28 -04:00
Scott Moser 7bf11ef883
Add support for --source on command line.
This provides the ability to install from a different source
by providing it on the command line.  So we can boot into a system,
and then run:
  subiquity --source=/tmp/xenial-server-cloudimg-amd64.squashfs
or
  subiquity --source=http://cloud-images.ubuntu.com/.../some.squashfs

And install that image rather than the hard coded paths.
2018-06-07 13:45:17 -04:00
Scott Moser c40a03a346 Do not specify partitioning commands in curtin config.
Subiquity was specifying the partitioning command to curtin like this:
    'partitioning_commands': {
        'builtin': 'curtin block-meta custom',
    },

That is not necessary, because the built-in config from curtin
is to do ['curtin', 'block-meta', 'simple'] which does the right thing
if storage config is provided.

In addition to that, because we specified a string, but curtin
was expecting an array, the log/status message that curtin would report
would show:
   running 'c u r t i n  b l o c k' ....
rather than:
   running 'curtin block-meta simple'
2018-06-07 12:28:50 -04: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
Michael Hudson-Doyle 14c8273597 fix crash in SnapList screen 2018-06-07 06:45:26 +12:00
Scott Moser 74a5f16535
Add main to subiquity, and use it frm make ui-view.
Add a main to subiquity so that you can run subiquity with:
 python3 -m subiquity
2018-06-06 14:30:03 -04:00
Michael Hudson-Doyle 865afe700b
Merge pull request #352 from smoser/cleanup/debian-packaging-cleanup
debian: minor package cleanups.
2018-06-06 16:07:36 +12:00
Scott Moser cda9b7f1c8 debian: minor package cleanups.
run 'wrap-and-sort' and drop bzr as a build-depends.
2018-06-05 23:41:48 -04:00
Michael Hudson-Doyle af7d536fa8
Merge pull request #350 from smoser/cleanup/make-and-tox-symmetry
Make tox and Makefile more similar.
2018-06-06 14:59:10 +12:00
Scott Moser af94275618 Make tox and Makefile more similar.
This does a few things with the end goal of making simplifying and
making consistent tox and 'make' methods of test or check.

Things here:
 * move python programs out of bin and into their own main.  Use
   entry_points to get scripts written for them.  One gain here is
   that we no longer have python programs that are not named .py.
   flake8 and friends would not check those programs by default.
 * install scripts in bin/ using the setup.py scripts and adjust
   snapcraft.yaml and debian packaging for that.
 * declare and use PYTHON in Makefile to avoid repeating 'python3'
 * declare and use CHECK_DIRS in Makefile for list of dirs to check.
 * no longer run 'flake8' from 'make check' by default.
 * remove the old tests/ directory.
2018-06-05 22:19:17 -04:00
Scott Moser bf807867c3 setup.py: fix package build. (#351)
Package build was broken with my last commit.
This restores functional debuild/dpkg-buildpackage.
2018-06-06 14:04:33 +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
Scott Moser 86826811a8 Remove dead controllers for ceph, iscsi, raid.
These controllers were broken (with failing 'imports') and were
not used.  Drop them, they can be resurrected at a later date when
needed.
2018-06-05 15:33:49 -04:00
Michael Hudson-Doyle c53b3dae8f change back to looking for ssh-import-id in answers 2018-06-01 10:22:55 +12:00
Michael Hudson-Doyle a64ae8bd82
Merge pull request #339 from CanonicalLtd/mwhudson/snap-screen
offer featured snaps for installation
2018-06-01 09:13:00 +12:00
Michael Hudson-Doyle f4c481860f remove a flag that is set but never checked 2018-06-01 09:04:16 +12:00
Michael Hudson-Doyle 19dd965461 some self-review 2018-05-31 12:31:02 +12:00
Michael Hudson-Doyle 738d8e11c7 oops 2018-05-31 11:58:58 +12:00
Michael Hudson-Doyle 49ad5c28ef switch to using cloud-init to download/install snaps 2018-05-31 10:53:01 +12:00
Michael Hudson-Doyle c044dc91b1 fix lint 2018-05-31 10:37:57 +12:00
Michael Hudson-Doyle eab0f668ff use general machinery a little more 2018-05-31 10:28:29 +12:00
Michael Hudson-Doyle 3f86d7594d move Padding outside SnapInfoView 2018-05-31 10:03:30 +12:00
Michael Hudson-Doyle 1a79a7679a fix selectability of snap description 2018-05-31 09:56:11 +12:00
Michael Hudson-Doyle f2d0d0aade update default snap store section and examples to server 2018-05-31 09:54:07 +12:00
Michael Hudson-Doyle 8e50ce252c Merge branch 'master' into mwhudson/snap-screen 2018-05-25 11:44:19 +12:00
Michael Hudson-Doyle 915bce02e0
Merge pull request #344 from CanonicalLtd/mwhudson/travis-tests
update travis jobs: test on cosmic, run make lint
2018-05-25 11:42:50 +12:00
Michael Hudson-Doyle 15a2c1867c fix lint 2018-05-25 11:26:14 +12:00
Michael Hudson-Doyle 293793fa49 merge master 2018-05-25 11:06:23 +12:00
Michael Hudson-Doyle 43f581bca4 update travis jobs: test on cosmic, run make lint 2018-05-25 10:56:01 +12:00
Michael Hudson-Doyle ed5e1d86b5 fix lint 2018-05-25 10:43:55 +12:00
Michael Hudson-Doyle 50e0ebebbf
Merge pull request #343 from raharper/feature/add-pyflakes
Add pep8 and pyflake3 targets and apply all of the fixes
2018-05-25 10:37:55 +12:00
Ryan Harper b55eb58501 pep8 fix, imports at top 2018-05-24 16:59:32 -05:00
Ryan Harper 618142f132 Rework make lint target to use pep8 pyflakes3 targets 2018-05-24 16:59:32 -05:00
Ryan Harper f8745a1cc3 pyflakes3 fixes for bin/console-conf-tui 2018-05-24 16:59:31 -05:00
Ryan Harper 5f8b562361 Add bin/*tui to pyflakes3 check 2018-05-24 16:59:31 -05:00
Ryan Harper 3ff00ff866 pep8 fixes for bin/subiquity-tui 2018-05-24 16:59:31 -05:00
Ryan Harper 36c42179e2 pep8 fixes for bin/console-conf-tui 2018-05-24 16:59:31 -05:00