Skip to content

Module scrapli_cfg.exceptions

scrapli_cfg.exceptions

Expand source code
        
"""scrapli_cfg.exceptions"""
from scrapli.exceptions import ScrapliException


class ScrapliCfgException(ScrapliException):
    """Base scrapli_cfg exception"""


class PrepareNotCalled(ScrapliCfgException):
    """
    Raised when the `prepare` method has not been called

    This will only be raised in two scenarios:
    1) an `on_prepare` callable has been provided, yet `prepare` was not called
    2) `ignore_version` is False and `prepare` was not called

    If using a context manager this should never be raised as the enter method will handle things
    for you
    """


class TemplateError(ScrapliCfgException):
    """For errors relating to configuration templates"""


class FailedToDetermineDeviceState(ScrapliCfgException):
    """For issues determining device state (i.e. what mode is file prompt in, etc.)"""


class VersionError(ScrapliCfgException):
    """For errors related to getting/parsing/invalid versions"""


class ConfigError(ScrapliCfgException):
    """For configuration operation related errors"""


class InvalidConfigTarget(ConfigError):
    """User has provided an invalid configuration target"""


class FailedToFetchSpaceAvailable(ConfigError):
    """Unable to determine space available on filesystem"""


class InsufficientSpaceAvailable(ConfigError):
    """If space available on filesystem is insufficient"""


class GetConfigError(ConfigError):
    """For errors getting configuration from a device"""


class LoadConfigError(ConfigError):
    """For errors loading a configuration"""


class DiffConfigError(ConfigError):
    """For errors diffing a configuration"""


class AbortConfigError(ConfigError):
    """For errors aborting a configuration"""


class CommitConfigError(ConfigError):
    """For errors committing a configuration"""


class CleanupError(ScrapliCfgException):
    """For errors during cleanup (i.e. removing candidate config, etc.)"""
        
    

Classes

AbortConfigError

1
For errors aborting a configuration
Expand source code
        
class AbortConfigError(ConfigError):
    """For errors aborting a configuration"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

CleanupError

1
For errors during cleanup (i.e. removing candidate config, etc.)
Expand source code
        
class CleanupError(ScrapliCfgException):
    """For errors during cleanup (i.e. removing candidate config, etc.)"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

CommitConfigError

1
For errors committing a configuration
Expand source code
        
class CommitConfigError(ConfigError):
    """For errors committing a configuration"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

ConfigError

1
For configuration operation related errors
Expand source code
        
class ConfigError(ScrapliCfgException):
    """For configuration operation related errors"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

Descendants

  • scrapli_cfg.exceptions.AbortConfigError
  • scrapli_cfg.exceptions.CommitConfigError
  • scrapli_cfg.exceptions.DiffConfigError
  • scrapli_cfg.exceptions.FailedToFetchSpaceAvailable
  • scrapli_cfg.exceptions.GetConfigError
  • scrapli_cfg.exceptions.InsufficientSpaceAvailable
  • scrapli_cfg.exceptions.InvalidConfigTarget
  • scrapli_cfg.exceptions.LoadConfigError

DiffConfigError

1
For errors diffing a configuration
Expand source code
        
class DiffConfigError(ConfigError):
    """For errors diffing a configuration"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

FailedToDetermineDeviceState

1
For issues determining device state (i.e. what mode is file prompt in, etc.)
Expand source code
        
class FailedToDetermineDeviceState(ScrapliCfgException):
    """For issues determining device state (i.e. what mode is file prompt in, etc.)"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

FailedToFetchSpaceAvailable

1
Unable to determine space available on filesystem
Expand source code
        
class FailedToFetchSpaceAvailable(ConfigError):
    """Unable to determine space available on filesystem"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

GetConfigError

1
For errors getting configuration from a device
Expand source code
        
class GetConfigError(ConfigError):
    """For errors getting configuration from a device"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

InsufficientSpaceAvailable

1
If space available on filesystem is insufficient
Expand source code
        
class InsufficientSpaceAvailable(ConfigError):
    """If space available on filesystem is insufficient"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

InvalidConfigTarget

1
User has provided an invalid configuration target
Expand source code
        
class InvalidConfigTarget(ConfigError):
    """User has provided an invalid configuration target"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

LoadConfigError

1
For errors loading a configuration
Expand source code
        
class LoadConfigError(ConfigError):
    """For errors loading a configuration"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

PrepareNotCalled

1
2
3
4
5
6
7
8
Raised when the `prepare` method has not been called

This will only be raised in two scenarios:
1) an `on_prepare` callable has been provided, yet `prepare` was not called
2) `ignore_version` is False and `prepare` was not called

If using a context manager this should never be raised as the enter method will handle things
for you
Expand source code
        
class PrepareNotCalled(ScrapliCfgException):
    """
    Raised when the `prepare` method has not been called

    This will only be raised in two scenarios:
    1) an `on_prepare` callable has been provided, yet `prepare` was not called
    2) `ignore_version` is False and `prepare` was not called

    If using a context manager this should never be raised as the enter method will handle things
    for you
    """
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

ScrapliCfgException

1
Base scrapli_cfg exception
Expand source code
        
class ScrapliCfgException(ScrapliException):
    """Base scrapli_cfg exception"""
        
    

Ancestors (in MRO)

  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

Descendants

  • scrapli_cfg.exceptions.CleanupError
  • scrapli_cfg.exceptions.ConfigError
  • scrapli_cfg.exceptions.FailedToDetermineDeviceState
  • scrapli_cfg.exceptions.PrepareNotCalled
  • scrapli_cfg.exceptions.TemplateError
  • scrapli_cfg.exceptions.VersionError

TemplateError

1
For errors relating to configuration templates
Expand source code
        
class TemplateError(ScrapliCfgException):
    """For errors relating to configuration templates"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException

VersionError

1
For errors related to getting/parsing/invalid versions
Expand source code
        
class VersionError(ScrapliCfgException):
    """For errors related to getting/parsing/invalid versions"""
        
    

Ancestors (in MRO)

  • scrapli_cfg.exceptions.ScrapliCfgException
  • scrapli.exceptions.ScrapliException
  • builtins.Exception
  • builtins.BaseException