Univention Bugzilla – Attachment 5498 Details for
Bug 30816
Support of VLAN, Bonding, Bridges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix 1-11, UNTESTED
30816_umc-network.diff (text/plain), 9.00 KB, created by
Philipp Hahn
on 2013-10-08 07:57 CEST
(
hide
)
Description:
Fix 1-11, UNTESTED
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2013-10-08 07:57 CEST
Size:
9.00 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/js/de.po b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/js/de.po >index aeefbc7..0e648eb 100644 >--- a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/js/de.po >+++ b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/js/de.po >@@ -95,7 +95,7 @@ msgid "" > "<i>Bond</i> interfaces allows two or more physical network interfaces to be " > "coupled." > msgstr "" >-"<i>Bond</i> Geräte erlaubt einen Verbund von einem oder mehreren " >+"<i>Bond</i> Netzwerkschnittstellen erlaubt einen Verbund von einem oder mehreren " > "physikalischen Netzwerkgeräten." > > #: umc/js/setup/InterfaceWizard.js: umc/js/setup/InterfaceWizard.js: >@@ -103,7 +103,7 @@ msgid "" > "<i>Bridge</i> interfaces allows a physical network interface to be shared to " > "connect one or more network segments. " > msgstr "" >-"<i>Bridge</i> Geräte erlaubt physikalischen Netzwerkgeräten gemeinsam " >+"<i>Bridge</i> Netzwerkschnittstellen erlaubt physikalischen Netzwerkgeräten gemeinsam " > "benutzt zu werden um ein oder mehrere Netzwerksegemente miteinander zu " > "verbinden." > >@@ -120,7 +120,7 @@ msgid "" > "<i>VLAN</i> interfaces can be used to separate network traffic logically " > "while using only one or more physical network interfaces. " > msgstr "" >-"<i>VLAN</i> Geräte können benutzt werden, um Netzwerkverkehr logisch mit nur " >+"<i>VLAN</i> Netzwerkschnittstellen können benutzt werden, um Netzwerkverkehr logisch mit nur " > "einem oder mehreren physikalischen Netzwerkgeräten zu trennen." > > #: umc/js/setup/BasisPage.js: >@@ -193,31 +193,31 @@ msgstr "Bond konfiguration" > > #: umc/js/setup/InterfaceWizard.js: > msgid "Bond interface configuration" >-msgstr "Bond Gerätekonfiguration" >+msgstr "Bond Netzwekkonfiguration" > > #: umc/js/setup/InterfaceWizard.js: > msgid "Bond primary" >-msgstr "" >+msgstr "Primäre Bond-Netzwerkschnittstellen" > > #: umc/js/setup/InterfaceWizard.js: umc/js/setup/Interfaces.js: > msgid "Bond slaves" >-msgstr "" >+msgstr "Bond Kindnetzwerkschnittstellen" > > #: umc/js/setup/types.js: > msgid "Bonding" >-msgstr "" >+msgstr "Kanalbündelung (Bonding)" > > #: umc/js/setup/types.js: > msgid "Bridge" >-msgstr "" >+msgstr "Netzwerk-Bridge" > > #: umc/js/setup/InterfaceWizard.js: > msgid "Bridge configuration" >-msgstr "Bridge konfiguration" >+msgstr "Bridge-Konfiguration" > > #: umc/js/setup/InterfaceWizard.js: > msgid "Bridge interface configuration" >-msgstr "Bridge Gerätekonfiguration" >+msgstr "Bridge Netzwerkkonfiguration" > > #: umc/js/setup/InterfaceWizard.js: umc/js/setup/Interfaces.js: > msgid "Bridge ports" >@@ -376,7 +376,7 @@ msgstr "E-Mailadresse" > > #: umc/js/setup/types.js: > msgid "Ethernet" >-msgstr "" >+msgstr "Ethernet" > > #: umc/js/setup/NetworkPage.js: > msgid "External name server" >@@ -409,7 +409,7 @@ msgstr "" > > #: umc/js/setup/InterfaceWizard.js: > msgid "Forwarding delay" >-msgstr "" >+msgstr "Forwarding-Verzögerung" > > #: umc/js/setup/BasisPage.js: > msgid "Fully qualified domain name" >@@ -625,7 +625,7 @@ msgstr "Standorteinstellungen" > > #: umc/js/setup/InterfaceWizard.js: > msgid "MII link monitoring frequency" >-msgstr "" >+msgstr "MII-Trägerüberwachungsfrequenz" > > #: umc/js/setup/SystemRolePage.js: > msgid "Member server" >diff --git a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/network.py b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/network.py >index a42a7ea..3417fae 100644 >--- a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/network.py >+++ b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/network.py >@@ -200,6 +200,7 @@ class Interfaces(dict): > # set device order > device.order = i > i += 1 >+ device.start = True > > devices = dict((device, (subdevs - leave)) for device, subdevs in devices.iteritems() if device not in leave) > >@@ -290,10 +291,8 @@ class Device(object): > self._remove_old_fallback_variables() > > self.order = None >- self.start = True >- >- if self.ip4dynamic: >- self.type = 'dhcp' >+ self.start = False >+ self.type = 'manual' > > def _remove_old_fallback_variables(self): > # removes deprecated UCR variables from UCS <= 3.1-1... can be removed in future >@@ -304,6 +303,10 @@ class Device(object): > self.validate_name() > self.validate_ip4() > self.validate_ip6() >+ if self.ip4dynamic: >+ self.type = 'dhcp' >+ elif self.ipv4 or self.ipv6: >+ self.type = 'static' > > def validate_name(self): > """ >@@ -414,9 +417,7 @@ class Device(object): > > self.start = ucr.is_true(value=vals.pop('interfaces/%s/start' % (name), None)) > >- type_ = vals.pop('interfaces/%s/type' % (name), None) >- if type_ is not None: >- self.type = type_ >+ self.type = vals.pop('interfaces/%s/type' % (name), None) > > order = vals.pop('interfaces/%s/order' % (name), "") > if order.isdigit(): >@@ -428,11 +429,14 @@ class Device(object): > address, netmask = vals.pop('interfaces/%s/address' % (name), ''), vals.pop('interfaces/%s/netmask' % (name), '24') > if address: > self.ip4.append((address, netmask)) >- # a link local address indicates that this interface is DHCP >+ # a link-local address probably from a failed DHCP > if address.startswith('169.254.'): > self.type = 'dhcp' >+ # FIXME PMH: the above look wrong: a manually configured lla is >+ # still valid and may be preferred to an ever changing address when >+ # dhcp fails. > >- self.ip4dynamic = 'dhcp' == self.type >+ self.ip4dynamic = self.type in ('dhcp', 'dynamic') > self.ip6dynamic = ucr.is_true(value=vals.pop('interfaces/%s/ipv6/acceptRA' % (name), None)) > > for key in vals.copy(): >@@ -456,7 +460,7 @@ class Device(object): > self.options.sort() > self._leftover.sort() > >- def to_ucr(self): >+ def to_ucr(self, extra_options=None): > """Returns a dict of UCR variables to set or unset. > Values which are None should be unset. > """ >@@ -474,8 +478,8 @@ class Device(object): > if self.start is not None: > vals['interfaces/%s/start' % (name)] = str(bool(self.start)).lower() > >- if isinstance(self.type, str): >- if self.type not in ('static', 'manual', 'dhcp', 'appliance-mode-temporary'): >+ if isinstance(self.type, basestring): >+ if self.type not in ('static', 'manual', 'dhcp', 'dynamic', 'appliance-mode-temporary'): > MODULE.warn('Unknown interfaces/%s/type: %r' % (self.name, self.type)) > vals['interfaces/%s/type' % (name)] = self.type > >@@ -506,7 +510,7 @@ class Device(object): > > vals['interfaces/%s/ipv6/acceptRA' % (name)] = str(bool(self.ip6dynamic)).lower() > >- for i, option in enumerate(self.options): >+ for i, option in enumerate(self.options + (extra_options or [])): > vals['interfaces/%s/options/%d' % (name, i)] = option > > return vals >@@ -606,8 +610,8 @@ class VLAN(Device): > super(VLAN, self).validate_name() > if not '.' in self.name: > raise DeviceError(_('Invalid device name: %r') % (self.name,)) >- if not (1 <= self.vlan_id <= 4096): >- raise DeviceError(_('Invalid VLAN ID. Must be between 1 and 4096.'), self.name) >+ if not (1 <= self.vlan_id <= 4095): >+ raise DeviceError(_('Invalid VLAN ID. Must be between 1 and 4095.'), self.name) > > @property > def dict(self): >@@ -618,6 +622,27 @@ class VLAN(Device): > )) > return d > >+ def parse_ucr(self): >+ super(Bond, self).parse_ucr() >+ options = [] >+ for option in self.options: >+ try: >+ name, value = option.split(None, 1) >+ except ValueError: >+ name, value = option, '' >+ >+ if name == 'vlan-raw-device': >+ pass >+ else: >+ options.append(option) >+ self.options = options >+ >+ def to_ucr(self): >+ options = [ >+ 'vlan-raw-device %s' % (self.parent_device,), >+ ] >+ return super(Bond, self).to_ucr(options) >+ > > class Bond(Device): > """A network bonding interface""" >@@ -649,8 +674,6 @@ class Bond(Device): > # make sure that used interfaces does not have any IPv4 or IPv6 address > idevice.disable_ips() > >- self.type = 'manual' >- > def validate(self): > super(Bond, self).validate() > >@@ -731,15 +754,12 @@ class Bond(Device): > 'bond-slaves %s' % (' '.join(self.bond_slaves),), > 'bond-mode %s' % (self.bond_mode,), > ] >- if self.bond_primary: >+ if self.bind_mode == 1 and self.bond_primary: > options.append('bond-primary %s' % (' '.join(self.bond_primary),)) > if self.miimon is not None: > options.append('miimon %s' % (self.miimon,)) > >- vals = super(Bond, self).to_ucr() >- for i, option in enumerate(options, start=len(self.options)): >- vals['interfaces/%s/options/%d' % (self.name, i)] = option >- return vals >+ return super(Bond, self).to_ucr(options) > > > class Bridge(Device): >@@ -763,8 +783,6 @@ class Bridge(Device): > # make sure that used interfaces does not have any IPv4 or IPv6 address > idevice.disable_ips() > >- self.type = 'manual' >- > def validate(self): > super(Bridge, self).validate() > >@@ -812,10 +830,7 @@ class Bridge(Device): > 'bridge_fd %d' % (self.bridge_fd,), > ] > >- vals = super(Bridge, self).to_ucr() >- for i, option in enumerate(options, start=len(self.options)): >- vals['interfaces/%s/options/%d' % (self.name, i)] = option >- return vals >+ return super(Bridge, self).to_ucr(options) > > > if __name__ == '__main__':
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 30816
:
5352
|
5496
|
5498
|
5499
|
5509
|
5568