Univention Bugzilla – Attachment 3305 Details for
Bug 22670
Bridges per UCR
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
br* interfaces per UCR
bridge_interfaces.patch (text/plain), 5.06 KB, created by
Janis Meybohm
on 2011-06-07 14:20 CEST
(
hide
)
Description:
br* interfaces per UCR
Filename:
MIME Type:
Creator:
Janis Meybohm
Created:
2011-06-07 14:20 CEST
Size:
5.06 KB
patch
obsolete
>Index: debian/univention-config-registry.univention-config-registry >=================================================================== >--- debian/univention-config-registry.univention-config-registry (Revision 24721) >+++ debian/univention-config-registry.univention-config-registry (Arbeitskopie) >@@ -98,6 +98,7 @@ > Preinst: interfaces.py > Postinst: interfaces.py > Variables: interfaces/eth.* >+Variables: interfaces/br.* > Variables: interfaces/handler > Variables: gateway > >@@ -106,6 +107,8 @@ > Variables: interfaces/eth0/type > Variables: interfaces/eth.*/address > Variables: interfaces/eth.*/hosts >+Variables: interfaces/br.*/address >+Variables: interfaces/br.*/hosts > Variables: hostname > Variables: domainname > Variables: hosts/static/.* >@@ -116,6 +119,9 @@ > Variables: interfaces/eth.*/address > Variables: interfaces/eth.*/type > Variables: interfaces/eth.*/hosts >+Variables: interfaces/br.*/address >+Variables: interfaces/br.*/type >+Variables: interfaces/br.*/hosts > Variables: hostname > Variables: domainname > >Index: conffiles/hosts.d/00-base >=================================================================== >--- conffiles/hosts.d/00-base (Revision 24721) >+++ conffiles/hosts.d/00-base (Arbeitskopie) >@@ -11,15 +11,24 @@ > 127.0.0.1 localhost > > @!@ >-eth_devices=[] >+INTERFACE_TYPES = ['eth', 'br'] >+devices = [] > >+for type in INTERFACE_TYPES: >+ vars()['%s_devices' % type] = [] >+ > for key,value in configRegistry.items(): >- if key.startswith('interfaces/eth'): >- k = key.split("/")[1:2][0] >- if k not in eth_devices: >- eth_devices.append(k) >+ for type in INTERFACE_TYPES: >+ if key.startswith('interfaces/%s' % type): >+ k = key.split("/")[1:2][0] >+ if k not in vars()['%s_devices' % type]: >+ vars()['%s_devices' % type].append(k) > >-for i in eth_devices: >+for type in INTERFACE_TYPES: >+ vars()['%s_devices' % type].sort() >+ devices.extend( vars()['%s_devices' % type] ) >+ >+for i in devices: > if configRegistry['interfaces/%s/address' % i]: > name = configRegistry.get('interfaces/%s/hosts' % (i), '%s.%s %s' % (configRegistry['hostname'],configRegistry['domainname'],configRegistry['hostname'])) > if name: >Index: conffiles/network/interfaces >=================================================================== >--- conffiles/network/interfaces (Revision 24721) >+++ conffiles/network/interfaces (Arbeitskopie) >@@ -13,16 +13,22 @@ > iface lo inet loopback > > @!@ >+INTERFACE_TYPES = ['eth', 'br'] >+devices = [] > >-eth_devices=[] >+for type in INTERFACE_TYPES: >+ vars()['%s_devices' % type] = [] > > for key,value in configRegistry.items(): >- if key.startswith('interfaces/eth'): >- k = key.split("/")[1:2][0] >- if k not in eth_devices: >- eth_devices.append(k) >+ for type in INTERFACE_TYPES: >+ if key.startswith('interfaces/%s' % type): >+ k = key.split("/")[1:2][0] >+ if k not in vars()['%s_devices' % type]: >+ vars()['%s_devices' % type].append(k) > >-eth_devices.sort() >+for type in INTERFACE_TYPES: >+ vars()['%s_devices' % type].sort() >+ devices.extend( vars()['%s_devices' % type] ) > > def check_gateway (ip, netmask, gateway): > if not gateway: >@@ -36,13 +42,11 @@ > if samenet == 1: > return 1 > >- > gateway=False > configExists=False > ifhandler=configRegistry.get('interfaces/handler','ifplugd') > >- >-for i in eth_devices: >+for i in devices: > configExists=False > iface = i.replace("_", ":") > if configRegistry.has_key('interfaces/%s/type' % i) and configRegistry['interfaces/%s/type' % i] == 'dhcp': >@@ -54,7 +58,7 @@ > print 'auto %s' % iface > print 'iface %s inet dhcp' % iface > configExists=True >- elif configRegistry['interfaces/%s/address' % i]: >+ elif configRegistry['interfaces/%s/address' % i]: > print 'auto %s' % iface > print 'iface %s inet static' % iface > >@@ -70,6 +74,10 @@ > print 'gateway '+configRegistry['gateway'] > gateway=True > configExists=True >+ elif iface.startswith('br') and configRegistry.get('interfaces/%s/type' % i, '') == 'manual': >+ print 'auto %s' % iface >+ print 'iface %s inet %s' % (iface, configRegistry.get('interfaces/%s/type' % i)) >+ configExists=True > > if configExists: > for key,value in configRegistry.items(): >@@ -80,9 +88,11 @@ > for key,value in configRegistry.items(): > if key.startswith('interfaces/%s/options/' % i): > print value >+ if key.startswith('interfaces/%s/bridge/' % i): >+ print 'bridge_%s %s' % (key.split('/')[3], value) >+ > if i == "eth0": > if configRegistry.get('interfaces/eth0/netmask', "") == "255.255.255.255" and configRegistry.get('gateway', False): > print "up ip route add %s/32 dev eth0" % configRegistry["gateway"] > print "up route add default gw %s" % configRegistry["gateway"] >- > @!@ >Index: conffiles/interfaces.py >=================================================================== >--- conffiles/interfaces.py (Revision 24721) >+++ conffiles/interfaces.py (Arbeitskopie) >@@ -69,7 +69,8 @@ > > def preinst(baseConfig, changes): > for iface in set(changes): >- if baseConfig.has_key(iface): >+ # On "ucr unset" the variable does not exist anymore - shouldn't we bring down the interface? >+ if baseConfig.has_key(iface) or changes[iface][1] == '': > stop_iface(interface(iface)) > > def postinst(baseConfig, changes):
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 22670
: 3305