Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/python-bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bareos/bsock/protocolmessages.py')
-rw-r--r--bareos/bsock/protocolmessages.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/bareos/bsock/protocolmessages.py b/bareos/bsock/protocolmessages.py
deleted file mode 100644
index 0db3642..0000000
--- a/bareos/bsock/protocolmessages.py
+++ /dev/null
@@ -1,40 +0,0 @@
-"""
-Protocol messages between bareos-director and user-agent.
-"""
-
-from bareos.bsock.connectiontype import ConnectionType
-
-class ProtocolMessages():
- """
- strings defined by the protocol to talk to the Bareos Director.
- """
- @staticmethod
- def hello(name, type=ConnectionType.DIRECTOR):
- if type == ConnectionType.FILEDAEMON:
- return bytearray("Hello Director %s calling\n" % (name), 'utf-8')
- else:
- return bytearray("Hello %s calling\n" % (name), 'utf-8')
-
- #@staticmethod
- #def ok():
- #return "1000 OK:"
-
- @staticmethod
- def auth_ok():
- return b"1000 OK auth\n"
-
- @staticmethod
- def auth_failed():
- return b"1999 Authorization failed.\n"
-
- @staticmethod
- def not_authorized():
- return b"1999 You are not authorized.\n"
-
- @staticmethod
- def is_auth_ok(msg):
- return msg == ProtocolMessages.auth_ok()
-
- @staticmethod
- def is_not_authorized(msg):
- return msg == ProtocolMessages.not_authorized() \ No newline at end of file