Petr Sebek has uploaded a new change for review. Change subject: Added setupNetworks command to vdsClient ......................................................................
Added setupNetworks command to vdsClient To have ability to setup networks and bondings configuration from vdsClient. Change-Id: I0578caf5b5d9c4a4fb4a43b273f3fe2bdff9b03d Signed-off-by: Petr Sebek <pse...@redhat.com> --- M client/vdsClient.py 1 file changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/14132/1 diff --git a/client/vdsClient.py b/client/vdsClient.py index 1da7d5f..9c39c1f 100644 --- a/client/vdsClient.py +++ b/client/vdsClient.py @@ -1525,6 +1525,34 @@ for item in spec.split(',') if item) return spec + def do_setupNetworks(self, args): + networks = {} + bondings = {} + options = {} + for arg in args: + netparams = arg.split(',') + network = {} + if len(netparams) == 1: + key, value = netparams[0].split("=") + options[key] = value + else: + for netparam in netparams: + key, value = netparam.split("=", 1) + if key == 'nics': + network[key] = value.split("+") + continue + network[key] = value + if 'network' in network: + network_name = network['network'] + del network['network'] + networks[network_name] = network + elif 'bond' in network: + bond_name = network['bond'] + del network['bond'] + bondings[bond_name] = network + status = self.s.setupNetworks(networks, bondings, options) + return status['status']['code'], status['status']['message'] + def do_addNetwork(self, args): params = self._eqSplit(args) try: @@ -2340,6 +2368,15 @@ 'Get list of VMs from the pool or domain if sdUUID ' 'given. Run only from the SPM.' )), + 'setupNetworks': (serv.do_setupNetworks, + ('[connectivityCheck=0|1] ' + '[connectivityTimeout=<number>] [network=<name>,' + 'nic=<nic>,vlan=<number>,STP=<yes|no>,' + 'bridged=<true|false>,bonding=<name>] ' + '[bond=<name>,nics=<nic1+nic2+...>,' + 'options=<option>]', + 'Setup new configuration of networks and bonds.' + )), 'addNetwork': (serv.do_addNetwork, ('bridge=<bridge> [vlan=<number>] [bond=<bond>] ' 'nics=nic[,nic]', -- To view, visit http://gerrit.ovirt.org/14132 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0578caf5b5d9c4a4fb4a43b273f3fe2bdff9b03d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Petr Sebek <pse...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches