pyhpecw7.features.config module

Mange config files on HPCOM7 devices.

class pyhpecw7.features.config.Config(device, filename)[source]

Bases: object

This class is used to activate a new running config in real-time.

Parameters:
  • device (HPCOM7) – connected instance of a pyhpecw7.comware.HPCOM7 object.
  • filename (str) – absolute path to the file that will be compared and/or activated on the device.
device

connected instance of a pyhpecw7.comware.HPCOM7 object.

Type:HPCOM7
filename

absolute path to the file that will be compared and/or activated on the device.

Type:str
build(stage=False)[source]

Stage or execute configuration required to activate new config file.

This method stores the existing running configuration as flash:/safety_file.cfg, loads the new config file, and then stores the newly loaded file to flash:/startup.cfg.

Parameters:stage (bool) – whether to stage the commands or execute immediately
Returns:True if stage=True and staging is successful List of etree.Element XML responses if immediate execution
compare_config()[source]

Compare new config file to the existing current running config

Returns:This returns a tuple of two elements that are both lists.

The first element has a summary of diffs (self._diffs) and the second element is the exact output from the ‘display diff’ command, but as a list (self._original__diffs).