pyats.easypy.runinfo package

Submodules

class pyats.easypy.runinfo.base.RunInfo(*args, **kwargs)

Bases: pyats.easypy.base.Component

RunInfo classes provides the following functionality to the current Easypy running jobfile:

  • a runtime directory where all log/output goes to

  • an archive capability, where the above runtime directory is archived (saved to file).

  • upload mechanism, potentially uploading the given runtime/archive into an upstream log viewer/result aggregator.

Concepts:
  • RunInfo subclasses may implement how they wish to interpret the input argument runinfo_dir/archive_dir. The default implementation: - adds a yy-mm date nesting to the archive directory for structure - creates a folder under runinfo_dir using job id to be used as this

    run’s directory.

ARCHIVE_TIME_FMT = '%y-%m'
CFG_ARCHIVE_DIR = 'easypy.runinfo.archive'
CFG_RUNINFO_DIR = 'easypy.runinfo.directory'
DEFAULT_ARCHIVE_DIR = '/users/lsheikal/.pyats/archive'
DEFAULT_RUNINFO_DIR = '/users/lsheikal/.pyats/runinfo'
archive()

creates the archive file with the information taken from runinfo directory to the archive directory by using zip.

archive_maker()

This function makes an archive file :return: None

cleanup()

removes the runinfo directory at the end of execution

classmethod configure_parser(parser, legacy_cli=True)

configures the main runtime parser with this component’s own parser group.

Note

  • to be implemented by the component owner/developer.

  • should be adding argument groups and args to the provided parser

create()

creates the directories that were set in the __init__ method

class pyats.easypy.runinfo.jenkins.JenkinsRunInfo(*args, **kwargs)

Bases: pyats.easypy.runinfo.base.RunInfo

cleanup()

removes the runinfo directory at the end of execution

classmethod configure_parser(parser, legacy_cli=True)

extending base RunInfo parser with -archive_file which specifies the explicit location/path of where archive_file should be stored