diskimage_builder.block_device.tests.plugin package

Submodules

diskimage_builder.block_device.tests.plugin.test_a module

class diskimage_builder.block_device.tests.plugin.test_a.TestA(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.tests.plugin.test_a.TestANode(config, state, test_rollback)

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

do_rollback(string)
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

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.tests.plugin.test_b module

class diskimage_builder.block_device.tests.plugin.test_b.TestB(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.tests.plugin.test_b.TestBNode(config, state, test_rollback)

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

do_rollback(string)
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

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

Module contents