Module devtools

Various development utilities

  • License: Inmanta EULA

  • Version: 0.0.3

Plugins

devtools::debug.print(name: 'string', obj: 'std::Entity', *, waiters: 'list' = [], depth: 'int' = 1, now: 'bool' = False, show_location: 'bool' = False, render_null: 'bool' = True, use_logger: 'bool' = False)

Print debug information about an object in the model.

Parameters:
  • name – A name to assign to the printed object, as there can be multiple objects being printed out.

  • obj – The object to render

  • waiters – A list of values that should be set before this plugin runs

  • depth – The maximum depth that the rendering should show

  • now – Whether to print the instance now, or to wait for the end of the compile.

  • show_location – Whether to print the file and line of the object

  • remove_null – Whether to not print null entries (for optional values)

  • use_logger – Use logging lib, useful to debug test case for example.

devtools::handler_mock.hook(to_mock_prefixes: 'list' = ['']) -> 'bool'

Force this file to be loaded on the agent for EVERY resource It will mock all resources that start with something in the to_mock_prefixes list | arg | behaviour | | ————- | ——————————————– | | nothing | mock everything | | [“module::”] | every resource that start with “module::” | | [] | mock nothing (can be use to clean the agent) |

devtools::lsm.offline_inventory(inventory_file: 'string', *, save: 'bool' = False) -> 'bool'

Patches the lsm allocation to rely on an offline inventory. This offline inventory is a file, that should be loaded when lsm_services_list is called and updated when lsm_services_update_attributes and lsm_services_update_attributes_v2 are called.

Parameters:
  • inventory_file – A path to a file that should be loaded as the mocked service inventory.

  • save – Whether to save the changes applied to the different services at the end of the compile back into the file.

devtools::lsm.offline_service(service_entity: 'string', candidate_attributes: 'dict?', active_attributes: 'dict?', rollback_attributes: 'dict?', state: 'string', *, id: 'string?' = None, environment: 'string?' = None, version: 'int?' = None, config: 'dict?' = None, created_at: 'string?' = None, last_updated: 'string?' = None, callback: 'string[]?' = None, deleted: 'bool?' = None) -> 'bool'

Add a service with all the provided attributes to the mocked service inventory that will be used in the compile. This plugin can be called multiple times to add multiple services and can be used in combination with the offline_inventory plugin to add or update a service that was defined in there.

Parameters:
  • id – A unique uuid for this service instance

  • environment – The environment this service instance belongs to

  • service_entity – The name of the service entity defined in this environment

  • version – An opaque version identifier that is incremented on every state change. This identifier is strict monotonic and integer.

  • config – A dict with flags that override config in the service entity

  • state – The state of this instance. The state refers to a state defined in the service entity lifecycle

  • candidate_attributes – The set of attributes used when the service instance model state is candidate or designed.

  • active_attributes – The set of attributes when the model is evaluated with only active instances.

  • rollback_attributes – The set of attributes that can be used to rollback active attributes that result in an error state.

  • created_at – The timestamp indicating when this ServiceInstance was created.

  • last_updated – The timestamp of the last state transition of this ServiceInstance.

  • callback – A list of callback urls that are notified when the state of this instance changes.

  • deleted – Whether this service is deleted.