diskimage_builder.block_device.level3 package

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)

Bases: diskimage_builder.block_device.plugin.PluginBase

get_nodes()

Return nodes created by the plugin

Returns:a list of NodeBase objects for insertion into the graph
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 to create()

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.

umount()

Umount actions

Actions to taken when dib-block-device umount is called. The nodes are called in the reverse order to create()

Returns:None
diskimage_builder.block_device.level3.mount.cmp_mount_order(this, other)

Sort comparision function for mount-point sorting

See if this comes before other 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

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.