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:
-rwxr-xr-xbareos/bsock/bsockjson.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bareos/bsock/bsockjson.py b/bareos/bsock/bsockjson.py
index fc6786a..9fd67c0 100755
--- a/bareos/bsock/bsockjson.py
+++ b/bareos/bsock/bsockjson.py
@@ -20,7 +20,11 @@ class BSockJson(BSock):
super(BSockJson, self).__init__(
address, port, dirname, name,
password)
- self.call(".api 2")
+ # older version did not support compact mode,
+ # therfore first set api mode to json (which should always work in bareos >= 15.2.0)
+ # and then set api mode json compact (which should work with bareos >= 15.2.2)
+ self.call(".api json")
+ self.call(".api json compact=yes")
def call(self, command):