Univention Bugzilla – Attachment 8520 Details for
Bug 43663
Register Listener Modules via LDAP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
univention-lib.patch
univention-lib.patch (text/plain), 9.68 KB, created by
Stefan Gohmann
on 2017-03-12 18:44 CET
(
hide
)
Description:
univention-lib.patch
Filename:
MIME Type:
Creator:
Stefan Gohmann
Created:
2017-03-12 18:44 CET
Size:
9.68 KB
patch
obsolete
>Index: python/de.po >=================================================================== >--- python/de.po (Revision 77164) >+++ python/de.po (Arbeitskopie) >@@ -3,7 +3,7 @@ > msgstr "" > "Project-Id-Version: univention-lib\n" > "Report-Msgid-Bugs-To: packages@univention.de\n" >-"POT-Creation-Date: 2015-05-12 13:18+0200\n" >+"POT-Creation-Date: 2017-03-01 07:37+0100\n" > "PO-Revision-Date: 2016-01-14 11:26+0100\n" > "Last-Translator: Univention GmbH <packages@univention.de>\n" > "Language-Team: Univention GmbH <packages@univention.de>\n" >@@ -12,78 +12,83 @@ > "Content-Type: text/plain; charset=UTF-8\n" > "Content-Transfer-Encoding: 8bit\n" > >-#: python/package_manager.py:751 >+#: python/package_manager.py:782 > msgid "Autoremove failed" > msgstr "Deinstallation unbenutzter Pakete fehlgeschlagen" > >-#: python/package_manager.py:691 >+#: python/package_manager.py:701 python/package_manager.py:702 > msgid "Could not initialize package manager." > msgstr "Paketmanager konnte nicht initialisiert werden." > >-#: python/package_manager.py:745 >+#: python/package_manager.py:776 > #, python-format > msgid "Deleting unneeded %s" > msgstr "Deinstalliere unbenutztes Paket %s" > >-#: python/package_manager.py:715 >+#: python/package_manager.py:740 > msgid "Error: " > msgstr "Fehler: " > >-#: python/package_manager.py:645 >+#: python/package_manager.py:665 > msgid "Failed to install" > msgstr "Installation fehlgeschlagen" > >-#: python/package_manager.py:301 python/package_manager.py:428 >+#: python/package_manager.py:313 python/package_manager.py:445 > msgid "Failed to lock" > msgstr "Sperren des Systems fehlgeschlagen" > >-#: python/package_manager.py:650 >+#: python/package_manager.py:670 > msgid "Failed to uninstall" > msgstr "Deinstallation fehlgeschlagen" > >-#: python/package_manager.py:425 python/package_manager.py:633 >-#, python-format >+#: python/package_manager.py:440 python/package_manager.py:651 > msgid "Fetching failed" > msgstr "Herunterladen fehlgeschlagen" > >-#: python/package_manager.py:733 >+#: python/package_manager.py:763 > msgid "Further information regarding this error:" > msgstr "Weitere Informationen zu diesem Fehler:" > >-#: python/package_manager.py:454 >+#: python/package_manager.py:471 > msgid "No such package" > msgstr "Paket existiert nicht" > >-#: python/package_manager.py:724 >+#: python/package_manager.py:753 > msgid "" > "Probably another process is currently using it or the package sources are " > "corrupt. Please try again later." >-msgstr "Er wird möglicherweise zurzeit von einem anderen Prozess verwendet oder die Paketquellen sind korrupt. Bitte später erneut versuchen." >+msgstr "" >+"Er wird möglicherweise zurzeit von einem anderen Prozess verwendet oder die " >+"Paketquellen sind korrupt. Bitte später erneut versuchen." > >-#: python/package_manager.py:722 >+#: python/package_manager.py:751 > msgid "" > "Some package conflicts could not be resolved. This was probably caused by " > "packages with \"hold\" state." >-msgstr "Einige Paketkonflikte konnten nicht gelöst werden. Dies wird möglicherweise von Paketen mit \"hold\"-Status verursacht." >+msgstr "" >+"Einige Paketkonflikte konnten nicht gelöst werden. Dies wird möglicherweise " >+"von Paketen mit \"hold\"-Status verursacht." > >-#: python/package_manager.py:727 >+#: python/package_manager.py:756 > msgid "The package sources are probably corrupt." > msgstr "Die Paketquellen sind wahrscheinlich korrupt." > >-#: python/package_manager.py:730 >+#: python/package_manager.py:759 > msgid "" > "The sources.list entries could be repaired by executing the following " > "commands as root on this server:" >-msgstr "Die sources.list Einträge könnten durch ausführen der folgenden Kommandos als root auf diesem Server repariert werden:" >+msgstr "" >+"Die sources.list Einträge könnten durch ausführen der folgenden Kommandos " >+"als root auf diesem Server repariert werden:" > >-#: python/package_manager.py:720 >+#: python/package_manager.py:749 > msgid "There is no free hard disk space left on the device." > msgstr "Es ist kein freier Speicherplatz auf dem Gerät verfügbar." > >-#: python/package_manager.py:561 >+#: python/package_manager.py:579 > msgid "Untrusted origin" > msgstr "Nicht vertrauenswürdige Quelle" > >-#: python/package_manager.py:714 >+#: python/package_manager.py:739 > msgid "Warning: " > msgstr "Warnung: " >Index: python/ldap_extension.py >=================================================================== >--- python/ldap_extension.py (Revision 77164) >+++ python/ldap_extension.py (Arbeitskopie) >@@ -175,6 +175,14 @@ > with open(udm_hook_messagecatalog, 'r') as f: > common_udm_options.extend(["--append", "messagecatalog=%s %s" % (language, base64.b64encode(f.read()),), ]) > >+ if self.udm_module_name == "settings/listener": >+ for servers in options.listenerservers: >+ common_udm_options.extend(["--append", "servers=%s" % (servers), ]) >+ >+ if self.udm_module_name == "settings/ucr_extension": >+ for servers in options.ucrservers: >+ common_udm_options.extend(["--append", "servers=%s" % (servers), ]) >+ > rc, self.object_dn, stdout = self.udm_find_object_dn() > if not self.object_dn: > >@@ -785,6 +793,41 @@ > return True > > >+class UniventionListener(UniventionLDAPExtension): >+ __metaclass__ = ABCMeta >+ >+ target_container_name = "listener" >+ udm_module_name = "settings/listener" >+ active_flag_attribute = "univentionListenerActive" >+ filesuffix = ".py" >+ >+ #def register(self, filename, options, udm_passthrough_options, target_filename=None): >+ # # Determine UDM module name >+ # saved_value = sys.dont_write_bytecode >+ # sys.dont_write_bytecode = True >+ # sys.dont_write_bytecode = saved_value >+ # >+ # UniventionLDAPExtension.register(self, filename, options, udm_passthrough_options, target_filename=module_name + ".py") >+ >+ def wait_for_activation(self, timeout=180): >+ if not UniventionLDAPExtension.wait_for_activation(self, timeout): >+ return False >+ >+ timeout = 60 >+ print "Waiting for file %s:" % (self.filename,), >+ t0 = time.time() >+ while not os.path.exists(self.filename): >+ if time.time() - t0 > timeout: >+ print "ERROR" >+ print >>sys.stderr, "ERROR: Timout waiting for %s." % (self.filename,) >+ return False >+ sys.stdout.write(".") >+ sys.stdout.flush() >+ time.sleep(3) >+ print "OK" >+ return True >+ >+ > class UniventionUDMModule(UniventionUDMExtension): > target_container_name = "udm_module" > udm_module_name = "settings/udm_module" >@@ -846,11 +889,11 @@ > > > class UCSOption (Option): >- TYPES = Option.TYPES + ("existing_filename", "ucs_version", ) >- TYPE_CHECKER = copy(Option.TYPE_CHECKER) >- TYPE_CHECKER["existing_filename"] = option_validate_existing_filename >- TYPE_CHECKER["ucs_version"] = option_validate_ucs_version >- TYPE_CHECKER["gnu_message_catalogfile"] = option_validate_gnu_message_catalogfile >+ TYPES = Option.TYPES + ("existing_filename", "ucs_version", ) >+ TYPE_CHECKER = copy(Option.TYPE_CHECKER) >+ TYPE_CHECKER["existing_filename"] = option_validate_existing_filename >+ TYPE_CHECKER["ucs_version"] = option_validate_ucs_version >+ TYPE_CHECKER["gnu_message_catalogfile"] = option_validate_gnu_message_catalogfile > > > def option_callback_udm_passthrough_options(option, opt_str, value, parser, *args): >@@ -927,6 +970,14 @@ > action="append", type="existing_filename", default=[], > help="UDM hook", metavar="<filename>") > >+ parser.add_option("--listener", dest="listener", >+ action="append", type="existing_filename", default=[], >+ help="Listener module", metavar="<filename>") >+ >+ parser.add_option("--ucr", dest="ucr", >+ action="append", type="existing_filename", default=[], >+ help="UCR extension", metavar="<filename>") >+ > parser.add_option("--packagename", dest="packagename", > help="Package name") > parser.add_option("--packageversion", dest="packageversion", >@@ -989,6 +1040,18 @@ > help="File containing LDAP bindpwd", metavar="<filename>") > parser.add_option_group(auth_options) > >+ listener_options = OptionGroup(parser, "Listener specific options") >+ listener_options.add_option("--listenerservers", dest="listenerservers", >+ default=[], action="append", >+ help="Specify servers (FQDN) on which the listener module has to be installed", metavar='<Servers>') >+ parser.add_option_group(listener_options) >+ >+ ucr_options = OptionGroup(parser, "UCR specific options") >+ ucr_options.add_option("--ucrservers", dest="ucrservers", >+ default=[], action="append", >+ help="Specify servers (FQDN) on which the UCR extension has to be installed", metavar='<Servers>') >+ parser.add_option_group(ucr_options) >+ > opts, args = parser.parse_args() > if len(opts.udm_module) > 1: > parser.error('--udm_module option can be given once only.') >@@ -997,7 +1060,7 @@ > if not opts.packageversion: > parser.error('--packageversion option is required.') > >- if not (opts.schemafile or opts.aclfile or opts.udm_syntax or opts.udm_hook or opts.udm_module): >+ if not (opts.schemafile or opts.aclfile or opts.udm_syntax or opts.udm_hook or opts.udm_module or opts.listener or opts.ucr): > parser.print_help() > sys.exit(2) > >@@ -1050,6 +1113,24 @@ > univentionUDMModule.register(udm_module, opts, udm_passthrough_options) > objects.append(univentionUDMModule) > >+ if opts.listener: >+ if UniventionListener.create_base_container(ucr, udm_passthrough_options) != 0: >+ sys.exit(1) >+ >+ for listener in opts.listener: >+ univentionListener = UniventionListener(ucr) >+ univentionListener.register(listener, opts, udm_passthrough_options) >+ objects.append(univentionListener) >+ >+ if opts.ucr: >+ if UniventionUCR.create_base_container(ucr, udm_passthrough_options) != 0: >+ sys.exit(1) >+ >+ for ucrextension in opts.ucr: >+ univentionUCR = UniventionUCR(ucr) >+ univentionUCR.register(ucrextension, opts, udm_passthrough_options) >+ objects.append(univentionUCR) >+ > for obj in objects: > if not obj.wait_for_activation(): > print "%s: registraton of %s failed." % (functionname, obj.filename)
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 43663
: 8520 |
8521
|
8522