Configuration Manager

class AdvConfigMgr.StorageManagerManager(config_manager, managers=None, cli_parser_name='cli', cli_manager=None, storage_config=None, default_storage_managers=None)[source]

A class to handle storage managers

Parameters:
  • config_manager – a link to the ConfigurationManager object
  • managers – the managers to be registered. The first manager passed will be imported as the default
  • cli_parser_name – the name of the cli parser if not ‘cli’, if None, this will disable CLI parsing.
  • cli_manager – None uses the standard CLI Parser, this allows replacement of the default cli manager
read(sections=None, storage_names=None, override_tags=False, data=None)[source]

runs the read from storage process for the selected or configured managers

Parameters:
  • storage_names – If None, will read from all starnard storage managers, if a string or list, will read from the selected ones following the configured tag settings.
  • sections – If None, will read from all sections, if string or list, will read from the selected ones following the configured tag settings.
  • override_tags – if True, this will override the configured storage name settings allowing things like exporting the full config etc.
  • data – if a single storage name is passed, then data can be passed to that storage manager for saving. this will raise an AssignmentError if data is not None and more than one storage name is passed.
write(sections=None, storage_names=None, override_tags=False, **kwargs)[source]

runs the write to storage process for the selected or configured managers

Parameters:
  • storage_names – If None, will write to all starnard storage managers, if a string or list, will write to the selected ones following the configured tag settings.
  • sections – If None, will write to all sections, if string or list, will write to the selected ones following the configured tag settings.
  • override_tags – if True, this will override the configured storage name settings allowing things like exporting the full config etc.
Returns:

if ONLY one storage_name is passed, this will return the data from that manager if present.