def _exit(self, status, messages): msgs = messages if isinstance(messages, str): msgs = [msgs] msg = "\n".join(msgs) nagios_exit(status, msg, no_status_line=True)
def exit(self, status=0, message=None): """ Prints a usage message incorporating the message to stderr and exits with the given return value. @param status: the return value, which should given back to the operating system @type status: int @param message: the message to emit on exit. @type message: str """ try: super(NpArgParser, self).exit(status, message) except SystemExit: nagios_exit(status, '', no_status_line=True)