Commit Graph

4747 Commits

Author SHA1 Message Date
Ryan Harper 040382ac21 Implment add_bcache_device to filesystem model
Very similiar to adding a raid device, bcache has
fewer inputs and calculations.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-13 10:27:57 -06:00
Ryan Harper e2d9ea0f50 Update BcacheAction object
Add __eq__ method and use action_id as parameter.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-13 10:10:33 -06:00
Ryan Harper d7585f0506 Rename logdir and logfile to be more specific
logdir -> .subiquity
logfile -> subiquity-debug.log

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-13 09:41:02 -06:00
Ryan Harper cdfe2779b8 Handle PermissionError on logfile gracefully
Don't stacktrace the error, print it out nicely.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-13 08:36:29 -06:00
Ryan Harper bd31dea5c6 Fix lint in actions.py
make check missed when fixing wiping superblock by default

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-11 09:34:20 -06:00
Ryan Harper 67a174453f Bump subiquity version for release
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-11 09:33:39 -06:00
Ryan Harper 6f0a7cbbbb NetAction should initialize params and subnets
We initialized params and subnets to empty lists.
Params is expected to be a dictionary while subnets
is a list.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-11 08:36:52 -06:00
Ryan Harper cca4ff1fbe Always wipe disks by default
Update DiskAction to defaulting to wipe the superblock

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-10 22:49:34 -06:00
Ryan Harper cebce4db6c Fix add-raid-dev signal
Rework of the menu signals broke add-raid-dev by mapping a
menu signal to a completion signal.  Revert add-raid-dev back
to non-menu signal to fix.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-10 22:32:59 -06:00
Ryan Harper e48ba70501 Merge pull request #121 from CanonicalLtd/add_bonding_ux
Add initial bonding UX panels and model connections
2015-11-10 22:12:12 -06:00
Ryan Harper 408cdbfb71 Add initial bonding UX panels and model connections
We now have a bonding UX panel, modeled after the raid menu
where we have a list of interfaces and a radiobox for
selecting the bond mode.  This calls into the network
model to add the bond interface.

- Update the network view to only display the Bond option if we have
more than one interface that is available (ie, not already part of
a bond).
- Also update the bond info to include the bond interface composition
in the hardware info such that it displays according to spec
- Add iface_is_bonded_slave to model
- Update network model info dict to include bond_{slave,master}.  This
helps us display the (Bonded) attribute for slaves, but not the primary
bond iface.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-09 15:34:43 -06:00
Adam Stokes 70a6ef3f5b Merge pull request #120 from CanonicalLtd/network-ux-update
Network ux update
2015-11-06 15:39:41 -05:00
Ryan Harper 1ab56772b4 Fix network view for setting default route
- Spec calls for a list of gateway ips followed by a list of interfaces
  which are associated to be displayed
- Use updated model.set_default_gateway() method
- Add Default gateway status message to Network View
- Ensure that manually assigned gateways are displayed in the set default
  route view by extracting the 'gateway' value from the subnets in
  the Networkdev object.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 13:38:21 -06:00
Ryan Harper 5298092d15 Update example probe data to include info from latest probert
Probert includes network info on bonds and bridges, include this
data as we now rely upon it in the network model.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 10:38:03 -06:00
Ryan Harper 8a469b1774 Refix handling of no-nics
When fixing the width of the column for network interface names
we re-introduced a bug that occurs when a host has no nics
available.  Fix this again.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 10:36:58 -06:00
Ryan Harper e097cc81c4 Update network view 'done' to use updated model
The model makes use of Networkdev objects, when the
user is ready, done will extract the current configuration
from the devices and emit the actions.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 10:11:33 -06:00
Ryan Harper fe7faaa038 Modify ip source output in view
Match the same ordering of provider and method between the
main network view and the manual configuration views.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 10:03:46 -06:00
Ryan Harper 1788d89557 Update manual network config ux to use network model objects
- Use get_interface method to obtain and Networkdev object
and interact with this.  Validates {add,remove}_subnet methods
on Networkdev objects.
- Add method in model for setting and validating gateway values

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 09:52:05 -06:00
Ryan Harper e83981c063 Update network config view to use interface object
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 09:33:30 -06:00
Ryan Harper a164fffad7 Overhaul networkin model and networking actions
The network model wasn't not prepared to allow manual configuration
to affect the state such that after manual configuration the view
would be able to extract the current state of a network device
config.  Reuse the Blockdev model as Networkdev as well as encapsulating
the use of the action objects as a means of storting the current
configuration.

Adjust the views to use the updated model.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-06 09:19:44 -06:00
Ryan Harper 5086b00263 Fetch manual configuration
Collect and apply manual ipv4 interface configuration and update
the model.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-04 09:50:58 -06:00
Ryan Harper c6b3298f84 Clean up network configure interface view
- Call into model to extract interface info to populate view
- Clearly display two modes, ipv4 and v6
- Change button style, ideally we'd make a new one that doesn't indent by two
  chars
- Disabled ipv6 button for now

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-03 16:57:27 -06:00
Ryan Harper 8fe3d3c28a Merge pull request #118 from CanonicalLtd/fix_empty_username
Validate realname, username, and passwords on identity page
2015-11-03 14:08:45 -06:00
Ryan Harper b75cc356aa Validate realname, username, and passwords on identity page
- Apply limits to realname (1..160)
- Apply limits to username (1..32)
- Restrict chars allowed for realname via RealnameEditor widget
- Ensure all fields have input

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-03 14:00:05 -06:00
Ryan Harper bc30e87e4c Merge pull request #117 from CanonicalLtd/on_finish_add_quit_button
Make exiting installer easier
2015-11-03 13:18:34 -06:00
Ryan Harper 6ab9f7a58b Make exiting installer easier
- Add a 'Quit Installer' button on the final install progress screen. This
is useful for users who want to mess around with the system post-install.
- Redirect 'Reboot' to 'quit' if we're in dry-run mode.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-03 13:08:15 -06:00
Ryan Harper c6b5322c77 Merge pull request #112 from CanonicalLtd/fix-escape-ux
Refactor signals to improve navigation
2015-11-03 12:51:57 -06:00
Ryan Harper 9664f60408 make check: fix lint issue with signal rework
Fix up flake8 issues.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-03 12:44:17 -06:00
Ryan Harper 1f7383a0f5 Merge branch 'fix-escape-ux' of github.com:CanonicalLtd/subiquity into fix-escape-ux 2015-11-03 12:37:11 -06:00
Ryan Harper 4e0ae6a44e Refactor signals to improve navigation
Implement a stack-based signal class to push and pop menu levels
Switch navigation signals to use 'menu:' for filtering
Ensure all view classes subclass from ViewPolicy for common keypress

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-03 09:03:16 -06:00
Adam Stokes 0702ac9c95 Merge pull request #115 from CanonicalLtd/hide_raid_menu_as_needed
Hide raid menu as needed
2015-11-02 19:50:30 -05:00
Adam Stokes 6caf75b990 Merge pull request #116 from CanonicalLtd/run_flake8_via_python3
Run flake8 via python3
2015-11-02 19:50:17 -05:00
Ryan Harper 1b66a555ae Makefile: add make check
make check now calls lint and unit

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 16:49:31 -06:00
Ryan Harper 1dbd8f52c8 Complete flake8 fix across the tree
Now that we're using python3 flake8, let's fix all of those issues!

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 16:48:37 -06:00
Ryan Harper 9296df7501 make lint: run flake8 via python3
Running flake8 via python3 triggers python3 level of lint checking.
This fixes at least the case where python2 flags the '_*' expander.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 15:27:14 -06:00
Ryan Harper f7f817bab5 models:filesystem reset devices and info blocks
When we create virtual deviecs (raid, lvm and bcache)
we store constructed info dictionaries; these must be
removed when we reset the model state.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 15:19:50 -06:00
Ryan Harper 25c78ba9fd Only display raid menu if we have enough disks
If we don't have at least 2 available disks, we cannot create
a raid, lvm or bcache.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 15:16:15 -06:00
Adam Stokes be8b4d53b7 Merge pull request #114 from CanonicalLtd/fix-show-disk-info
Fix show-disk-info from breaking on devices without a bus
2015-11-02 14:44:35 -05:00
Ryan Harper 57be9d82b9 Fix show-disk-info from breaking on devices without a bus
When fixing show-disk-info on virtio devices, a thinko when
indexing the info structure caused issues when looking at
a secondary clause in a compound statement.  Fix this by
extracting the value via a .get and checking.
- Also include a probert dump of a virtio-based cloud image
for testing with virtio devices.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 13:39:09 -06:00
Adam Stokes ce4194f3a5 Merge pull request #113 from CanonicalLtd/better_mount_checking
Better mount checking
2015-11-02 14:11:51 -05:00
Ryan Harper 654da3d917 Implement a MountEditor class to prevent invalid mountpoint input
Apply a regex to input for mountpoints, rejecting invalid keys

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 12:55:07 -06:00
Ryan Harper 55203050f3 Impose PATH_MAX on mountpoint
Don't allow very long paths.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 12:06:51 -06:00
Ryan Harper ad50d65e7e Scope ui/vi/filesystems logging
Include the ui path in the view logging to help indicate which parts of the MVC
are logging debug data.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 11:45:49 -06:00
Ryan Harper 43fd6034bb Consolidate mountpoint validation
- Move mountpoint validation into the model for re-use now that
we have two users of it (AddFormat, AddPartition).
- Use Exceptions to pass back the error message to be updated on
the widget.
- Fix issue with repeated checking of the mountpoint which would
grow the error message continually.
- Fix issue with selected device indexing.  This was missed due to
a misspelling of the signal it emitted and accidently behaved as
we expected.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 11:43:33 -06:00
Ryan Harper 25db3fdf28 views/filesystem: separate input disk from disk object
When instantiating the filesystem views we operate on the
input (converting disk string to disk object) but then in
the error paths, submitted the disk-object as the reference
which blew up the device dictionary. Now we explicitly keep
both the input and the object and use accordingly.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-11-02 11:09:34 -06:00
Ryan Harper 97574c175f Refactor signals to improve navigation
Implement a stack-based signal class to push and pop menu levels
Switch navigation signals to use 'menu:' for filtering
Ensure all view classes subclass from ViewPolicy for common keypress

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-29 15:58:51 -05:00
Ryan Harper d5a99a9dba Bump to version 0.0.3
Release 0.0.3

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-28 10:12:44 -05:00
Ryan Harper 1327b86d5e Makefile: extract version from python source
Pull subiquity version from the python module.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-28 10:12:06 -05:00
Ryan Harper 50d859e866 Reduce size of rootfs layer and common mkfs and rsync options
Attempt to shrink the partition size for the rootfs via mkfs options
Ensure we use the same mkfs and rsync options everywhere.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-28 09:56:09 -05:00
Ryan Harper f5eb8faef4 Switch to 1M alignment for partition calculations
Make sure we continue to use 1M alignment, this helps
parted shift things around properly.  Don't reserve
space for root in installer image since it's read-only.
Add some fudge factor to the root image to allow for
sparse expansion.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-27 15:35:05 -05:00