(self, message)
return status == 0
Send instant message using ejabberctl (from postmaster)
Send instant message using ejabberctl (from postmaster)
Send instant message using ejabberctl ( from postmaster )
def sendMessage(self, message):
        """Send instant message using ejabberctl (from postmaster)"""

        args = [ 'ejabberdctl', 'send_message', 'chat' ]

        # Send message text. By default the postmaster account is used
        args.append(self.alerts_from)
        args.append(self.alerts_recipient)

        # No subject for chat messages
        args.append('')

        # Add the message content
        args.append(message)

        # Send the message
        status = self.runCommand(args, "Sending XMPP message")

        # If not, raise an exception to avoid writing files in a directory
        if status.returncode != 0:
            logging.error("Error when sending xmpp message: ", status.stderr)
            raise RuntimeError(status.stderr)

        return status == 0
def sendMessage ( self , message ) : args = [ 'ejabberdctl' , 'send_message' , 'chat' ] # Send message text. By default the postmaster account is used args . append ( self . alerts_from ) args . append ( self . alerts_recipient ) # No subject for chat messages args . append ( '' ) # Add the message content args . append ( message ) # Send the message status = self . runCommand ( args , "Sending XMPP message" ) # If not, raise an exception to avoid writing files in a directory if status . returncode != 0 : logging . error ( "Error when sending xmpp message: " , status . stderr ) raise RuntimeError ( status . stderr ) return status == 0