mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-20 17:59:00 +00:00
library: avoid calls to AnsibleUtil.fail_json() but raise exception
This commit is contained in:
parent
f3b5fed04a
commit
14cc53f7ca
1 changed files with 2 additions and 3 deletions
|
|
@ -2013,8 +2013,7 @@ class _AnsibleUtil(RunEnvironment):
|
|||
try:
|
||||
c = ArgValidator_ListConnections().validate(self.params['connections'])
|
||||
except ValidationError as e:
|
||||
self.fail_json('configuration error: %s' % (e),
|
||||
warn_traceback = False)
|
||||
raise MyError('configuration error: %s' % (e))
|
||||
self._connections = c
|
||||
return c
|
||||
|
||||
|
|
@ -2290,7 +2289,7 @@ class Cmd_nm(Cmd):
|
|||
try:
|
||||
nmclient = Util.NM().Client.new(None)
|
||||
except Exception as e:
|
||||
AnsibleUtil.fail_json('failure loading libnm library: %s' % (e))
|
||||
raise MyError('failure loading libnm library: %s' % (e))
|
||||
self._nmutil = NMUtil(nmclient)
|
||||
return self._nmutil
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue