mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
improved spacewalk.call return values
This commit is contained in:
parent
38d9fe7134
commit
6dd1fc4429
@ -183,13 +183,17 @@ def call(server_url, command, *args, **kwargs):
|
||||
namespace, method = command.split('.')
|
||||
endpoint = getattr(getattr(client, namespace), method)
|
||||
|
||||
ret = {}
|
||||
try:
|
||||
result = endpoint(key, *arguments)
|
||||
ret['result'] = True
|
||||
except Exception as e:
|
||||
result = 'failed'
|
||||
result = False
|
||||
ret['changes'] = 'failed'
|
||||
|
||||
call = '{0} {1}'.format(command, arguments)
|
||||
return {call: result}
|
||||
ret['changes'][call] = result
|
||||
return ret
|
||||
|
||||
|
||||
def addGroupsToKey(server_url, activation_key, groups):
|
||||
|
Loading…
Reference in New Issue
Block a user