Dan Kenigsberg has uploaded a new change for review.
Change subject: configNet: support PREFIX option ......................................................................
configNet: support PREFIX option
PREFIX=16 means NETMASK=255.255.0.0.
Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M vdsm/configNetwork.py 1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/9322/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index 3940446..4bdb160 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -29,6 +29,8 @@ from xml.sax.saxutils import escape import glob import shutil +import socket +import struct
import libvirt import selinux @@ -865,6 +867,21 @@ _validateInterNetworkCompatibility(_netinfo, vlan, nic, bridged)
+def _prefix2netmask(prefix): + return socket.inet_ntoa( + struct.pack( + "!I", + int( + ( + ''.ljust(prefix, '1') + + ''.ljust(32 - prefix, '0') + ), + 2 + ) + ) + ) + + def addNetwork(network, vlan=None, bonding=None, nics=None, ipaddr=None, netmask=None, mtu=None, gateway=None, force=False, configWriter=None, bondingOptions=None, bridged=True, @@ -876,6 +893,15 @@ if mtu: mtu = int(mtu)
+ prefix = int(options.get('PREFIX')) + if prefix: + if netmask is None: + netmask = _prefix2netmask(prefix) + del options['PREFIX'] + else: + raise ConfigNetworkError(ne.ERR_BAD_PARAMS, + 'Both PREFIX and NETMASK supplied') + # Validation if not utils.tobool(force): logging.debug('validating network...')
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/45/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/68/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/69/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/46/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/69/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/46/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
Thanks!
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) Have this also in lower case as the new fedora form? Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) could you tell me more abut the "new fedora form"? is it something new initscripts? Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) It always complained to be that the capital is obsolete and I should use lower case... strange! I cannot find the documentation.
Igor? Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) At stderr of addNetwork I get:
WARNING:root:options BOOTPROTO is deprecated. Use bootproto instead WARNING:root:options ONBOOT is deprecated. Use onboot instead Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) Saggi is right that the new vdsm api prefers lowercase options to be passed. It is checked in line vdsm/API.py:1195 (call) and method of the same file lines 1397-1411.
In view of this. the check here should be for prefix only in lowercase form (as API.py should translate it once you add the line 'PREFIX': 'prefix' to translateNetOptionsToNew _translationMap.
Having said that, I am not aware of this being a new Fedora form, as http://docs.fedoraproject.org/en-US/Fedora/17/html/System_Administrators_Gui... does not mention any change happening. Anyway, we should be consistent with the deprecation messages of our own API. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) Must be both, as bootstrap code passes the ifcfg variables as-is. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) You're right Alon. Sorry that I put Saggi before (I was writing too late :-P). Why don't we add the call to translateNetOptions in deployUtil/vds_bootstrap and avoid this multiple checks? Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('PREFIX')) I never understood why the ALLCAPS form was not good enough for us. Oh well, I will add PREFIX to that conversion.
Putting this conversion (and any excessive logic for that matter...) in bootstrap sounds wrong. Supporting PREFIX in vdsm proper is not hard or dangerous... Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['PREFIX']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/98/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/65/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/65/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/98/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) I thought that to avoid adding a conversion in bootstrap you'd check here both 'prefix' and 'PREFIX'. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) this is functionally the same as the code here (see API.py change). Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) So I don't understand how it worked so far when I passed all in capitals. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) I do not follow you, Alon. PS1 supported only ALLCAPS. You two asked to behave like we do with BOOTPROTO and stuff, where alllower is considered preferable, and both are accepted.
I believe that I've complied with your request, have I not? Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) Maybe... I may don't understand the code... sorry... but if the above statement is working with both PREFIX and prefix is provided, I am good. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
(1 inline comment)
I had not gone deep enough in my deployUtil.py.in reading to see that this version is good. Now I can approve.
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) AFAICT, as it is now, deployUtil.py.in will read the parameters in caps and feed them back in caps to addNetwork. However, it is true that _getBridgeParams will not encounter 'PREFIX' as it is not part of ifcfg-* file format.
For this reason. IMO The change is correct. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) So why do we have[1]?
[1] https://bugzilla.redhat.com/show_bug.cgi?id=866540 Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) I was checking the fedora docs for ifcfg-* files and I don't see a mention to 'PREFIX'. However, checking /etc/sysconfig/network-scripts/ifup-aliases I can see it there as the alternative to NETMASK. Thus, I was wrong in accepting this change, since as I understand, deployUtils.py.in will get prefix in caps via _getBridgeParams and pass it in caps to addNetwork, making it necessary to do options.get('PREFIX') as well as options.get('prefix'). Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Hunt Xu has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: (1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) addNetwork then called API.Global.translateNetOptionsToNew before actually adding so I believe it's fine here with options.get('prefix') Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
(1 inline comment)
.................................................... File vdsm/configNetwork.py Line 892: Line 893: if mtu: Line 894: mtu = int(mtu) Line 895: Line 896: prefix = int(options.get('prefix')) Great. Thank yo for clarification. Line 897: if prefix: Line 898: if netmask is None: Line 899: netmask = _prefix2netmask(prefix) Line 900: del options['prefix']
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
I had misunderstood a part of deployUtil functionality. It is right.
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/125/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/91/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/91/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/125/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 4: Verified
oops, former version crashes if PREFIX is not passed. this version is verified
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 4: Looks good to me, but someone else must approve
Good catch. We should search other appearances of casts and gets, probably.
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: configNet: support PREFIX option ......................................................................
Patch Set 4: Looks good to me, approved
actually, it's a slow and late catch :-(
but I think we're good now.
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: configNet: support PREFIX option ......................................................................
configNet: support PREFIX option
PREFIX=16 means NETMASK=255.255.0.0.
Bug-Url: https://bugzilla.redhat.com/866540 Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M vdsm/API.py M vdsm/configNetwork.py 2 files changed, 27 insertions(+), 0 deletions(-)
Approvals: Antoni Segura Puimedon: Looks good to me, but someone else must approve Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/9322 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I1d87818642aa2092533f4864728c5ecd5d64f740 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org