Univention Bugzilla – Attachment 7183 Details for
Bug 39395
univention-system-activation: missing uuid in appcenter notification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
wsgi.py.patch
wsgi.py.patch (text/plain), 1.40 KB, created by
Felix Botner
on 2015-09-23 17:14:33 CEST
(
hide
)
Description:
wsgi.py.patch
Filename:
MIME Type:
Creator:
Felix Botner
Created:
2015-09-23 17:14:33 CEST
Size:
1.40 KB
patch
obsolete
>Index: src/wsgi.py >=================================================================== >--- src/wsgi.py (Revision 63446) >+++ src/wsgi.py (Arbeitskopie) >@@ -4,8 +4,25 @@ > import subprocess > import json > import re >+from ldif import LDIFParser > from univention.config_registry import ConfigRegistry > >+class LicenseLDIF(LDIFParser): >+ def __init__(self, input, ucr): >+ LDIFParser.__init__(self, input) >+ self.ucr = ucr >+ self.uuid = None >+ >+ @property >+ def uuid(self): >+ return self.uuid >+ >+ def handle(self, dn, entry): >+ if dn == 'cn=admin,cn=license,cn=univention,%s' % self.ucr.get('ldap/base'): >+ if 'univentionLicenseKeyID' in entry and len(entry['univentionLicenseKeyID']) > 0: >+ self.uuid = entry['univentionLicenseKeyID'][0] >+ >+ > ucr = ConfigRegistry() > ucr.load() > >@@ -97,14 +114,19 @@ > 'message': exc.output > }) > >+ ucr.load() >+ >+ # get uuid from ldif file, ucr['uuid/license'] is not yet up-to-date at this point >+ license_ldif = LicenseLDIF(open(LICENSE_UPLOAD_PATH, 'rb'), ucr) >+ license_ldif.parse() >+ > # disable system activation service (stop is executed with a small delay) > # and answer request >- ucr.load() > apps = get_installed_apps() > subprocess.Popen(['/usr/bin/sudo', '/usr/sbin/univention-system-activation', 'stop'], stderr=subprocess.STDOUT) > return _finish('200 OK', { > 'success': True, >- 'uuid': ucr.get('uuid/license', ''), >+ 'uuid': license_ldif.uuid, > 'apps': apps, > }) >
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 39395
: 7183