bareos / python-bareos

Python libraries to access Bareos
7 stars 10 forks source link

Command 'status job=cutejob returns error' #9

Open IvanBayan opened 6 years ago

IvanBayan commented 6 years ago

Looks like i found another bug, there is output from bconsole:

*status job=oracle_weekly_ow-backup03
Job "oracle_weekly_ow-backup03" is not running.

Python:

In [136]: console.call("status job=oracle_weekly_ow-backup03")
Out[136]: 
{u'error': {u'code': 1,
  u'data': {u'messages': {u'error': [u'Job "oracle_weekly_ow-backup03" is not running.\n']},
   u'result': {}},
  u'message': u'failed'},
 u'id': None,
 u'jsonrpc': u'2.0'}

Am i wrong and it's expected behavior?

PS I found another strange behavior, bconsole:

*.status dir current
1000 OK .status

Python:

In [137]: console.call(".status dir current")
Out[137]: {}

Should i open another one issue for that?

joergsteffens commented 6 years ago

Well, you already opened an additional issue.

In principle it is the same as stated in https://github.com/bareos/python-bareos/issues/8.

Not all commands support JSON output. You can access them by bareos.bsock.DirectorConsole, but not with bareos.bsock.DirectorConsoleJson.

Our reasoning has been, that the information provides by status dir can also, and even better retrieved by list job=oracle_weekly_ow-backup03.

Status information from daemons other then the Director are hard to retrieve, has the communication between daemon is not handled as JSON.

IvanBayan commented 6 years ago

Sorry if i misunderstood you, but status dir and list job=... completely different commands. I want to use status dir to check is director is running normally or not, same time i use list job=... to retrieve information about job.