diskimage_builder.block_device.level3 package¶
Submodules¶
diskimage_builder.block_device.level3.mount module¶
-
class
diskimage_builder.block_device.level3.mount.
Mount
(config, defaults, state)¶
-
class
diskimage_builder.block_device.level3.mount.
MountPointNode
(mount_base, config, state)¶ Bases:
diskimage_builder.block_device.plugin.NodeBase
-
create
()¶ Main creation driver
This is the main driver function. After the graph is linearised, each node has it’s
create()
function called.- Raises
Exception – A failure should raise an exception. This will initiate a rollback. See
Nodebase.add_rollback()
.- Returns
None
-
delete
()¶ Cleanup actions
Actions to taken when
dib-block-device delete
is called. This is the cleanup path in case of a reported external failure. The nodes are called in the reverse order tocreate()
- Returns
None
-
get_edges
()¶ Insert all edges
The dependency edge is created in all cases from the base element (typically a mkfs) and, if this is not the ‘first’ mount-point, an edge is created from the mount-point before in “sorted order” (see
sort_mount_points()
). This ensures that during mounting (and umounting) the globally correct order is used.
-
-
diskimage_builder.block_device.level3.mount.
cmp_mount_order
(this, other)¶ Sort comparision function for mount-point sorting
See if
this
comes beforeother
in mount-order list. In words: if the other mount-point has us as it’s parent, we come before it (are less than it). e.g./var < /var/log < /var/log/foo
- Parameters
this – tuple of mount_point, node name
other – tuple of mount_point, node name
- Returns int
cmp value