| Server IP : 170.10.162.208 / Your IP : 216.73.216.181 Web Server : LiteSpeed System : Linux altar19.supremepanel19.com 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64 User : deltahospital ( 1806) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /lib/python2.7/site-packages/pynag/Parsers/ |
Upload File : |
# -*- coding: utf-8 -*-
"""Module for errors shared among pynag.Parsers package."""
from __future__ import absolute_import
import pynag.errors
class ParserError(pynag.errors.PynagError):
""" ParserError is used for errors that the Parser has when parsing config.
Typical usecase when there is a critical error while trying to read configuration.
"""
filename = None
line_start = None
message = None
def __init__(self, message=None, item=None):
""" Creates an instance of ParserError
Args:
message: Message to be printed by the error
item: Pynag item who caused the error
"""
self.message = message
if item is None:
return
self.item = item
self.filename = item['meta']['filename']
self.line_start = item['meta'].get('line_start')
def __str__(self):
message = self.message
if self.filename and self.line_start:
message = '%s in %s, line %s' % (message, self.filename, self.line_start)
return repr(message)