Commit Graph

4269 Commits

Author SHA1 Message Date
Ryan Harper e192fd1088 Safe exit only on control-x
The single key 'Q' or 'q' was a bridge too far since we take
input at anytime and can surprise users.  Instead use a key
combination, control-x.  Clean up keypress handlers to match
urwid requirements (return None when handled, otherwise False,
or pass to super.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-21 13:03:15 -05:00
Adam Stokes 4ee6a812ba Merge pull request #91 from CanonicalLtd/add_control_c_handler
Add control-c signal handler
2015-10-21 11:55:38 -04:00
Ryan Harper aba2963779 Add control-c signal handler
Control-c dumps python stack trace.  Instead, just exit cleanly by
hooking SIGINT.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-21 10:18:34 -05:00
Adam Stokes 4d8f113b10 Merge pull request #90 from CanonicalLtd/disk-no-serial-fallback-path
Use storage path if disks don't have valid serial numbers
2015-10-21 10:34:44 -04:00
Ryan Harper b5bea5110f Use storage path if disks don't have valid serial numbers
Some disk devices (virtio) don't have serial numbers by default.
This breaks curtin which requires a serial or a path to uniquely
find the target disks.  Add a fallback to device path if the
current device includes the eye catcher 'Unknown Serial' which
is set by probert for devices that do not have a serial number.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-21 09:28:51 -05:00
Ryan Harper 60af07ebf0 Release 0.0.2
Bump version for a new build.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-20 18:26:02 -05:00
raharper be1a01b94f Merge pull request #87 from CanonicalLtd/fix-geninstaller-subiquity-tar
Update geninstaller paths for tarball creation
2015-10-20 16:59:43 -05:00
Ryan Harper fa1ed52195 Update geninstaller paths for tarball creation
We're no longer packaging curtin_wrap.sh so we don't need to
tar up the bin dir.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-20 16:57:49 -05:00
raharper 453ddf473b Merge pull request #86 from CanonicalLtd/error_on_no_curtin
Ensure install progress fails with missing curtin
2015-10-20 16:25:17 -05:00
Ryan Harper 4af4394d18 Ensure install progress fails with missing curtin
If we fail to find curtin, we don't return a valid path
and this confuses the run async, so instead return
/bin/false which will return non-zero and trip the
async failure detection.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-20 16:21:32 -05:00
Adam Stokes 1785885bda Merge pull request #85 from CanonicalLtd/new_kitt
Simplify kitt spinner
2015-10-16 18:14:14 -04:00
Ryan Harper 6dc885f5ed Simplify kitt spinner
Testing this out, I never saw any of the utf-8 output.
Instead use simple ascii ala kirby.  Also replace the
try:except with a modulo operation to index the list.
Drop the futures import.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-16 13:36:46 -05:00
Adam Stokes b4ad1dded6 Stop alarm on curtin error
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-10-13 00:54:47 -04:00
Adam Stokes 12431bff20 Update progress indicator
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-10-13 00:51:06 -04:00
Adam Stokes 03c2805d45 Merge pull request #84 from CanonicalLtd/implement-md-model
Implement md model
2015-10-09 10:17:26 -04:00
Ryan Harper d6de9e097d Merge branch 'implement-md-model' of github.com:CanonicalLtd/subiquity into implement-md-model 2015-10-09 08:59:55 -05:00
Ryan Harper f60759d4ab unittest: fsm:bootable,installable
- Unittests for bootable and installable
- Fix not bootable, missing False return

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper 525ae944b6 Go ahead and sort the partition list
We were using sorted but not storing the result. Do so now.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper c652650e1c unittest: add tests, filesystemmodel, blockdev
- add blockdev tests on available_partitions
- fix type issue in Disk.partition OrderedDict keys, always use integers
- Add __repr__ for Disk related Actions
- Fix issue with available partition logic, ensure we and them together
- Filter out 'leave unformatted' fstype, set to None as needed.
- Whitespace cleanup in unittests
- add fsm test on get_partitions

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper a5362fb398 unittest: add filesystemmodel add_device
- add add_device test

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper 29d3214051 unittest: filesystemmodel
- get_disk with partition name
- get_all_disks
- get_available_disks

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper c6e1f547df Add equality for Actions, Disks and Blockdev classes
Unittest on filesystem model require equality methods for
the various storage classes.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper 0017527e56 unittests for FilesystemModel
Add some probing data to use with the FilesystemModel
Add fakes class to handle fetching mock data
Add initial unittest

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper ed2f427ac9 Blockdev and unit test cleanups
- Use nosetests3 to call unit tests
- Ensure all Actions use the 'type' property
- Implement remaining Blockdev unit tests

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper bc34835918 Add tests/__init__.py and add new blockdev partition tests
Forgot to add __init__.py in tests subdir to make module.
Add a few blockdev partition tests and fixes for their issues.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper 7f3fc15426 Fix handling of empty disks and partitions for raid menu
mdadm supports using whole disks and empty partitions.
Update model to define empty disks and empty partitions.
This allows one to construct a raid, and then use that raid
to construct further raid (raid0 multiple raid1s).

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper bcd8486df4 Fix raid cancel, return to filesystem
Raid cancel quit, instead return to the filesystem view.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper f02c5e49f9 Don't allow multiple devices to be bootable
- Update filesystem model to check if we have an existing device
that's marked bootable.
- Update look at all disk mount points, not just the current one

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:38 -05:00
Ryan Harper eddc55faa0 First cut on raid ux and model integration
Introduce a new Raiddev class to hold raid virtual device.
Add RaidAction to emit correct storage config
Tested with raid level 0 only.
Not sure if we can allow partitioning of raid devices.  Documentation
says it can be done but curtin will need to 'make it correctly'.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-09 08:57:37 -05:00
Adam Stokes 7ecda311cd Dont dump pyyaml syntax
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-10-08 20:13:37 -04:00
Adam Stokes 33b9b62a9c Merge pull request #83 from CanonicalLtd/patch-configure-network-interface
Add manual ipv4 network configuration
2015-10-08 19:42:23 -04:00
Adam Stokes a82fb9e6a8 Add manual ipv4 network configuration
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-10-08 19:31:13 -04:00
Adam Stokes 4a878baa21 Merge pull request #82 from CanonicalLtd/patch-add-default-route
Add default gateway support
2015-10-08 17:27:48 -04:00
Adam Stokes 19c2d5a3b7 Add default gateway support
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-10-08 17:26:58 -04:00
Adam Stokes d2f65e72b3 Merge pull request #81 from CanonicalLtd/drop_jinja2_use
Drop jinja2 use
2015-10-08 16:45:21 -04:00
Ryan Harper 954b1d76fc Drop jinja2 use
We no longer use the jinja2 template file.  Drop its use and the deps.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-08 15:12:07 -05:00
Adam Stokes c9355e8433 Edit manual default route inline
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-10-08 16:11:53 -04:00
Ryan Harper 0acec7c246 Merge branch 'implement-md-model' of github.com:CanonicalLtd/subiquity into implement-md-model
Conflicts:
	subiquity/models/actions.py
	subiquity/models/blockdev.py
	subiquity/models/filesystem.py
2015-10-07 17:19:06 -05:00
Ryan Harper bc0041eb34 unittest: fsm:bootable,installable
- Unittests for bootable and installable
- Fix not bootable, missing False return

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 17:11:10 -05:00
Ryan Harper 18f3e33f7f Go ahead and sort the partition list
We were using sorted but not storing the result. Do so now.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 16:34:57 -05:00
Ryan Harper 410ff1da07 unittest: add tests, filesystemmodel, blockdev
- add blockdev tests on available_partitions
- fix type issue in Disk.partition OrderedDict keys, always use integers
- Add __repr__ for Disk related Actions
- Fix issue with available partition logic, ensure we and them together
- Filter out 'leave unformatted' fstype, set to None as needed.
- Whitespace cleanup in unittests
- add fsm test on get_partitions

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 15:24:19 -05:00
Ryan Harper 3e605f3b3b unittest: add filesystemmodel add_device
- add add_device test

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper 55b3f33f15 unittest: filesystemmodel
- get_disk with partition name
- get_all_disks
- get_available_disks

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper fc3fe29b93 Add equality for Actions, Disks and Blockdev classes
Unittest on filesystem model require equality methods for
the various storage classes.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper b7885dc480 unittests for FilesystemModel
Add some probing data to use with the FilesystemModel
Add fakes class to handle fetching mock data
Add initial unittest

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper f8141cc259 Blockdev and unit test cleanups
- Use nosetests3 to call unit tests
- Ensure all Actions use the 'type' property
- Implement remaining Blockdev unit tests

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper e9a7a0be52 Add tests/__init__.py and add new blockdev partition tests
Forgot to add __init__.py in tests subdir to make module.
Add a few blockdev partition tests and fixes for their issues.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper b5a8876038 Fix handling of empty disks and partitions for raid menu
mdadm supports using whole disks and empty partitions.
Update model to define empty disks and empty partitions.
This allows one to construct a raid, and then use that raid
to construct further raid (raid0 multiple raid1s).

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper 0e549dec40 Fix raid cancel, return to filesystem
Raid cancel quit, instead return to the filesystem view.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00
Ryan Harper ee8e25818a Don't allow multiple devices to be bootable
- Update filesystem model to check if we have an existing device
that's marked bootable.
- Update look at all disk mount points, not just the current one

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-07 08:48:07 -05:00