Univention Bugzilla – Attachment 5496 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 2,4,5 UNTESTED
30816_umc-network.diff (text/plain), 2.89 KB, created by
Philipp Hahn
on 2013-10-07 20:31 CEST
(
hide
)
Description:
Fix 2,4,5 UNTESTED
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2013-10-07 20:31 CEST
Size:
2.89 KB
patch
obsolete
>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..6bfbda8 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 >@@ -456,7 +456,7 @@ class Device(object): > self.options.sort() > self._leftover.sort() > >- def to_ucr(self): >+ def to_ucr(self, options=None): > """Returns a dict of UCR variables to set or unset. > Values which are None should be unset. > """ >@@ -506,7 +506,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 + (options or [])): > vals['interfaces/%s/options/%d' % (name, i)] = option > > return vals >@@ -606,8 +606,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 +618,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""" >@@ -731,15 +752,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): >@@ -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