diskimage-builder/diskimage_builder/block_device
Ian Wienand 35a1e7bee9 Refactor mount-point sorting
Currently we keep a global list of mount-points defined in the
configuration and automatically setup dependencies between mount nodes
based on their global "mount order" (i.e. higher directories mount
first).

The current method for achieving this is roughly to add the mount
points to a dictionary indexed my mount-point, then at "get_edge()"
call build the sorted list ... unless it has already been built
because this gets called for every node.

It seems much simpler to simply keep a sorted list of the
MountPointNode objects as we add them.  We don't need to implement a
sorting algorithm then, we can just use sort() and implement __lt__
for the nodes.

I believe the existing mount-order unit testing is sufficient; I'm
struggling to find a valid configuration where the mount-order is
*not* correctly specified in the configuration graph.

Change-Id: Idc05cdf42d95e230b9906773aa2b4a3b0f075598
2017-05-31 11:05:50 +10:00
..
level0 Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
level1 Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
level2 Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
level3 Refactor mount-point sorting 2017-05-31 11:05:50 +10:00
level4 Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
tests Refactor mount-point sorting 2017-05-31 11:05:50 +10:00
__init__.py Clear __init__.py from cmd move 2017-05-11 18:52:14 +10:00
blockdevice.py Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
cmd.py Refactor: use lazy logging 2017-05-30 14:39:58 +10:00
config.py Refactor: use lazy logging 2017-05-30 14:39:58 +10:00
exception.py Move exception to it's own file (again) 2017-05-20 06:44:39 +00:00
plugin.py Add state object, rename "results", add unit tests 2017-05-30 20:39:00 +10:00
utils.py Refactor mount-point sorting 2017-05-31 11:05:50 +10:00