Environment
- pyntc version: 3.2.3a1 (develop)
Observed Behavior
NotEnoughFreeSpaceError accepts required, available and file_system, uses them to build the message string, and then calls super().__init__(message) without storing any of them (errors.py L209-L226). The values are only recoverable by parsing message.
The message also prints the raw integers with no thousands separators, so a nine-digit byte count is hard to read and the shortfall has to be worked out by hand:
host1: bootflash: has 13456789 bytes free; 313456789 bytes required for transfer
Expected Behavior
The byte counts kept as attributes, so a caller can render its own message or compute the shortfall without a regex. The default message readable at a glance, including how much more space is needed.
Steps to Reproduce
>>> from pyntc.errors import NotEnoughFreeSpaceError
>>> err = NotEnoughFreeSpaceError(hostname="host1", required=313456789, available=13456789, file_system="bootflash:")
>>> err.required
AttributeError: 'NotEnoughFreeSpaceError' object has no attribute 'required'
Found while improving disk-space log messages in a downstream app, which currently has to regex the values back out of message.
Environment
Observed Behavior
NotEnoughFreeSpaceErroracceptsrequired,availableandfile_system, uses them to build the message string, and then callssuper().__init__(message)without storing any of them (errors.py L209-L226). The values are only recoverable by parsingmessage.The message also prints the raw integers with no thousands separators, so a nine-digit byte count is hard to read and the shortfall has to be worked out by hand:
Expected Behavior
The byte counts kept as attributes, so a caller can render its own message or compute the shortfall without a regex. The default message readable at a glance, including how much more space is needed.
Steps to Reproduce
Found while improving disk-space log messages in a downstream app, which currently has to regex the values back out of
message.