diskimage-builder/diskimage_builder/block_device
Ian Wienand 09dee46579 Move global mount tracking into state
Keep track of the mount-point ordering in a state variable, rather
than a global.  This path is tested by existing unit tests.

Note a prior change inserted the MountNode objects directly into a
list in self.state, which makes sorting quite easy as it can just
implement __lt__.  Unfortunately we still json dump the state, and
thus we can't have aribtrary objects in it (future work may be to
check keys inserted into the status object...).  So we have to do a
bit of wrangling with tuple lists and comparision functions here, but
it's not too bad.

Change-Id: I0c51e0c53c4efdb7a65ab0efe09a6780cb1affa8
2017-06-08 17:13:28 +10:00
..
level0 Remove 'state' argument from later cmd_* calls 2017-06-08 17:13:28 +10:00
level1 Add state to NodeBase class 2017-06-08 17:13:26 +10:00
level2 Use global state to check for duplicate fs labels 2017-06-08 17:13:28 +10:00
level3 Move global mount tracking into state 2017-06-08 17:13:28 +10:00
level4 Add state to NodeBase class 2017-06-08 17:13:26 +10:00
tests Move global mount tracking into state 2017-06-08 17:13:28 +10:00
__init__.py Clear __init__.py from cmd move 2017-05-11 18:52:14 +10:00
blockdevice.py Remove 'state' argument from later cmd_* calls 2017-06-08 17:13:28 +10:00
cmd.py Refactor: use lazy logging 2017-05-30 14:39:58 +10:00
config.py Add state to NodeBase class 2017-06-08 17:13:26 +10:00
exception.py Move exception to it's own file (again) 2017-05-20 06:44:39 +00:00
plugin.py Remove 'state' argument from later cmd_* calls 2017-06-08 17:13:28 +10:00
utils.py Refactor mount-point sorting 2017-05-31 11:05:50 +10:00