Martin Peřina has uploaded a new change for review. Change subject: api: Add fencingPolicy parameter to fenceNode ......................................................................
api: Add fencingPolicy parameter to fenceNode Adds fencingPolicy parameter to fenceNode API call. The parameter is optional, but it's supposed to be used in oVirt >= 3.5. The logic for specific items of fencingPolicy will be added in following patches. Change-Id: I7b1fd9521cebea28d0402e53d46d74b95e73f383 Bug-Url: https://bugzilla.redhat.com/1090799 Signed-off-by: Martin Perina <[email protected]> --- M vdsm/API.py M vdsm/rpc/BindingXMLRPC.py M vdsm/rpc/vdsmapi-schema.json 3 files changed, 23 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/30762/1 diff --git a/vdsm/API.py b/vdsm/API.py index 56acc56..04ccc11 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1134,7 +1134,7 @@ # General Host functions def fenceNode(self, addr, port, agent, username, password, action, - secure=False, options=''): + secure=False, options='', fencingPolicy=None): """Send a fencing command to a remote node. agent is one of (rsa, ilo, drac5, ipmilan, etc) @@ -1161,8 +1161,9 @@ return cleantext self.log.debug('fenceNode(addr=%s,port=%s,agent=%s,user=%s,passwd=%s,' - 'action=%s,secure=%s,options=%s)', addr, port, agent, - username, 'XXXX', action, secure, options) + 'action=%s,secure=%s,options=%s,fencingPolicy=%s)', + addr, port, agent, username, 'XXXX', action, secure, + options, fencingPolicy) if action not in ('status', 'on', 'off', 'reboot'): raise ValueError('illegal action ' + action) diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py index e2a08b1..6149c87 100644 --- a/vdsm/rpc/BindingXMLRPC.py +++ b/vdsm/rpc/BindingXMLRPC.py @@ -572,10 +572,10 @@ return api.setSafeNetworkConfig() def fenceNode(self, addr, port, agent, username, password, action, - secure=False, options=''): + secure=False, options='', fencingPolicy=None): api = API.Global() return api.fenceNode(addr, port, agent, username, password, action, - secure, options) + secure, options, fencingPolicy) def setLogLevel(self, level): api = API.Global() diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json index bd411a0..00a5240 100644 --- a/vdsm/rpc/vdsmapi-schema.json +++ b/vdsm/rpc/vdsmapi-schema.json @@ -291,6 +291,20 @@ {'enum': 'FenceNodePowerStatus', 'data': ['on', 'off', 'unknown']} ## +# @FencingPolicy: +# +# Additional options for fenceNode logic. +# +# @skipFencingIfSDActive: #optional If True, skip fence agent execution +# if host is connected to at least one storage +# domain +# +# Since: 4.16.0 +## +{'type': 'FencingPolicy', + 'data': {'*skipFencingIfSDActive': 'bool'}} + +## # @Host.fenceNode: # # Send a fencing command to a remote host. @@ -313,6 +327,8 @@ # @options: #optional Additional agent-specific parameters in space-separated # <var>=<val> pairs # +# @fencingPolicy: #optional Additional options needed in fenceNode logic +# # Returns: # The new power status of the remote node # @@ -321,7 +337,7 @@ {'command': {'class': 'Host', 'name': 'fenceNode'}, 'data': {'addr': 'str', 'port': 'int', 'agent': 'str', 'username': 'str', 'password': 'str', 'action': 'FenceNodeAction', '*secure': 'bool', - '*options': 'str'}, + '*options': 'str', '*fencingPolicy': 'FencingPolicy'}, 'returns': 'FenceNodePowerStatus'} ## -- To view, visit http://gerrit.ovirt.org/30762 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b1fd9521cebea28d0402e53d46d74b95e73f383 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Peřina <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
