From f59d9d8e10896627615770d9f88c5f32215bfb8b Mon Sep 17 00:00:00 2001 From: Joerg Steffens Date: Sun, 15 Nov 2015 11:14:24 +0100 Subject: use compact format of json api mode --- bareos/bsock/bsockjson.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3