Univention Bugzilla – Attachment 7922 Details for
Bug 42128
univention-network-manager should use the official UMC API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
42128.patch (text/plain), 1.96 KB, created by
Florian Best
on 2016-08-25 14:20:15 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-08-25 14:20:15 CEST
Size:
1.96 KB
patch
obsolete
>diff --git a/base/univention-network-manager/univention-register-network-address b/base/univention-network-manager/univention-register-network-address >index 89898c1..dec515d 100755 >--- a/base/univention-network-manager/univention-register-network-address >+++ b/base/univention-network-manager/univention-register-network-address >@@ -34,20 +34,29 @@ import sys > import optparse > import netifaces > import subprocess >+import httplib > import univention.config_registry > import univention.uldap >+from univention.lib.umc_connection import UMCConnection > > > def register_iface(configRegistry, iface, verbose): > # is fallback different from current address? >- p1 = subprocess.Popen(['/usr/sbin/umc-command', '-U', '%s$' % configRegistry.get('hostname'), '-y', '/etc/machine.secret', '-s', configRegistry.get('ldap/master'), 'ip/change', '-o' ,'ip=%s' % configRegistry.get('interfaces/%s/address' % iface), '-o', 'oldip=%s' % configRegistry.get('interfaces/%s/fallback/address' % iface), '-o', 'netmask=%s' % configRegistry.get('interfaces/%s/netmask' % iface), '-o', 'role=%s' % configRegistry.get('server/role')], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) >- res = p1.communicate() >- if p1.returncode != 0: >- print 'ERROR: IP registration for %s failed with code %s' % (iface,p1.returncode) >+ def err(error): > if verbose: >- print 'More information: %s\n%s' % (res[1], res[0]) >+ print error >+ try: >+ connection = UMCConnection.get_machine_connection(err) >+ return connection.request('ip/change', { >+ 'ip': configRegistry.get('interfaces/%s/address' % iface), >+ 'oldip': configRegistry.get('interfaces/%s/fallback/address' % iface), >+ 'netmask': configRegistry.get('interfaces/%s/netmask' % iface), >+ 'role': configRegistry.get('server/role') >+ }).get('success', True) >+ except (RuntimeError, ValueError, EnvironmentError, httplib.HTTPException) as exc: >+ if verbose: >+ print '%s: %s' % (type(exc).__name__, exc) > return False >- return True > > > 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
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 42128
:
7922
|
9073