diskimage_builder.block_device.level2 package

Submodules

diskimage_builder.block_device.level2.mkfs module

class diskimage_builder.block_device.level2.mkfs.FilesystemNode(config, state)

Bases: 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

get_edges()

Return the dependencies/edges for this node

This function will be called after all nodes are created (this is because some plugins need to know the global state of all nodes to decide their dependencies).

This function returns a tuple with two lists

  • edges_from : a list of node names that point to us

  • edges_to : a list of node names we point to

In most cases, node creation will have saved a single parent that was given in the base parameter of the configuration. A usual return might look like:

def get_edges(self):
    return ( [self.base], [] )

Some nodes (level0) don’t have a base, however

class diskimage_builder.block_device.level2.mkfs.Mkfs(config, defaults, state)

Bases: PluginBase

Create a file system

This block device module handles creating different file systems.

get_nodes()

Return nodes created by the plugin

Returns:

a list of NodeBase objects for insertion into the graph

Module contents