os.chown(str(tmp_file), fstat.st_uid, fstat.st_gid)
LOG.info(_("Renaming {src!r} => {tgt!r}.").format(
- src=str(tmp_file), tgt=(output_file)))
+ src=str(tmp_file), tgt=str(output_file)))
tmp_file.rename(output_file)
from fb_tools.common import pp, to_str, to_bool, is_sequence
from fb_tools.obj import FbBaseObjectError, FbBaseObject
-__version__ = '1.1.2'
+from .xlate import XLATOR
+
+__version__ = '1.2.1'
LOG = logging.getLogger(__name__)
+_ = XLATOR.gettext
+ngettext = XLATOR.ngettext
+
# =============================================================================
class ModuleInfoError(FbBaseObjectError):
match = self.re_split_name.match(_full_name)
if not match:
raise ModuleInfoError(
- "Could not analyze given full module name {!r}.".format(
+ _("Could not analyze given full module name {!r}.").format(
full_name))
self._full_name_orig = _full_name
else:
if not _name or not _vendor:
- msg = (
+ msg = _(
"There must be given a full module name or the base module name "
"and the vendor name (user name on Puppet Forge).")
raise ModuleInfoError(msg)
def merge_in(self, other):
if not isinstance(other, ModuleInfo):
- raise ModuleInfoTypeError((
- "Parameter {p!r} is not of class ModuleInfoTypeError, but of class {c} "
- " instead.").format(p=other, c=other.__class__.__name__))
+ raise ModuleInfoTypeError(_(
+ "Parameter {p!r} is not of class {e}, but of class {c} instead.").format(
+ p=other, e='ModuleInfoTypeError', c=other.__class__.__name__))
if other.forge_avail is not None and self.forge_avail is None:
self.forge_avail = other.forge_avail
def init_from_json(cls, json_data, env, appname=None, verbose=0, base_dir=None):
if 'name' not in json_data:
- LOG.warn("Did not found module name in json.")
+ LOG.warn(_("Did not found module name in json."))
return None
module_info = None
LOG.debug("Trying to init module_info from:\n{}".format(pp(data)))
if 'full_name' not in data:
- LOG.warn("Did not found module name in data.")
+ LOG.warn(_("Did not found module name in data."))
return None
module_info = None
rest = cls.re_def_token.sub('', rest)
tokens.append(token)
else:
- LOG.warn("Could not analyze definitions in {!r}".format(rest))
+ LOG.warn(_("Could not analyze definitions in {!r}.").format(rest))
break
if verbose > 4:
val = match.group(2)
defs[key] = val
else:
- LOG.warn("Could not analyze definition token {!r}.".format(token))
+ LOG.warn(_("Could not analyze definition token {!r}.").format(token))
if verbose > 4:
LOG.debug("Got definitions:\n{}".format(pp(defs)))
url = "{url}/{name}".format(url=forge_uri, name=full_name)
module_info = None
- LOG.info("Trying to get module {m!r} from Puppet forge {u!r} ...".format(
+ LOG.info(_("Trying to get module {m!r} from Puppet forge {u!r} ...").format(
m=full_name, u=url))
session = requests.Session()
return None
if not response.text:
- LOG.warn("No output for URL {!r}".format(url))
+ LOG.warn(_("No output for URL {!r}.").format(url))
return None
if verbose > 3:
msg = "Output:\n{}".format(response.text)
if 'version' in js_info['current_release']:
version = js_info['current_release']['version']
else:
- msg = "Did not found version of current_release of module {}.".format(full_name)
+ msg = _("Did not found version of current release of module {}.").format(full_name)
LOG.warn(msg)
if 'metadata' in js_info['current_release'] and js_info['current_release']['metadata']:
if ('source' in js_info['current_release']['metadata'] and
js_info['current_release']['metadata']['source']):
source = str(js_info['current_release']['metadata']['source']).strip()
if not source:
- LOG.warn("Did not found source information of module {}.".format(full_name))
+ LOG.warn(_("Did not found source information of module {}.").format(full_name))
else:
- msg = "Did not found current_release of module {}.".format(full_name)
+ msg = _("Did not found current release of module {}.").format(full_name)
LOG.warn(msg)
LOG.debug("Current version of module {name} is {version}.".format(
from .module_info import ModuleInfo
-__version__ = '1.2.1'
+from .xlate import XLATOR
+
+__version__ = '1.3.1'
LOG = logging.getLogger(__name__)
+_ = XLATOR.gettext
+ngettext = XLATOR.ngettext
+
+
# =============================================================================
class ModuleInfoDict(MutableMapping, FbBaseObject):
"""
modules['puppet-mongodb'] returns a ModuleInfo object for puppet module 'puppet-mongodb'
"""
- msg_invalid_modinfo_type = "Invalid value type {!r} to set, only ModuleInfo allowed."
- msg_key_not_name = "The key {k!r} must be equal to the full name {n!r} of the module."
- msg_none_type_error = "None type as key is not allowed."
- msg_empty_key_error = "Empty key {!r} is not allowed."
- msg_no_modinfo_dict = "Object {!r} is not a ModuleInfoDict object."
+ msg_invalid_modinfo_type = _("Invalid value type {{!r}} to set, only {} allowed.").format(
+ 'ModuleInfo')
+ msg_key_not_name = _("The key {k!r} must be equal to the full name {n!r} of the module.")
+ msg_none_type_error = _("None type as key is not allowed.")
+ msg_empty_key_error = _("Empty key {!r} is not allowed.")
+ msg_no_modinfo_dict = _("Object {{!r}} is not a {} object.").format('ModuleInfoDict')
# -------------------------------------------------------------------------
# __init__() method required to create instance from class.
msgstr ""
"Project-Id-Version: puppetmaster_webhooks 1.3.1\n"
"Report-Msgid-Bugs-To: frank.brehm@pixelpark.com\n"
-"POT-Creation-Date: 2019-01-02 11:21+0100\n"
+"POT-Creation-Date: 2019-01-02 18:20+0100\n"
"PO-Revision-Date: 2019-01-02 11:25+0100\n"
"Last-Translator: Frank Brehm <frank.brehm@pixelpark.com>\n"
"Language: de_DE\n"
msgid "Reading metadata files of environment {!r} ..."
msgstr "Lese Metadaten-Dateien von Umgebung {!r} ⋯"
-#: lib/webhooks/get_forge_modules.py:284
+#: lib/webhooks/get_forge_modules.py:287
msgid "Got no module info from directory {!r}."
msgstr "Keine Modul-Informationen aus dem Verzeichnis {!r} erhalten."
-#: lib/webhooks/get_forge_modules.py:293
+#: lib/webhooks/get_forge_modules.py:296
msgid "Directory {!r} does not exists."
msgstr "Das Verzeichnis {!r} existiert nicht."
-#: lib/webhooks/get_forge_modules.py:297
+#: lib/webhooks/get_forge_modules.py:300
msgid "Path {!r} is not a directory."
msgstr "Der Pfad {!r} is kein Verzeichnis."
-#: lib/webhooks/get_forge_modules.py:302
+#: lib/webhooks/get_forge_modules.py:305
msgid "Metadatafile {!r} does not exists."
msgstr "Die Metadaten-Datei {!r} existiert nicht."
-#: lib/webhooks/get_forge_modules.py:305
+#: lib/webhooks/get_forge_modules.py:308
msgid "Metadatafile {!r} is not a regular file."
msgstr "Die Metadaten-Datei {!r} ist keine reguläre Datei."
-#: lib/webhooks/get_forge_modules.py:308
+#: lib/webhooks/get_forge_modules.py:311
msgid "No read access to metadatafile {!r}."
msgstr "Kein Lesezugriff auf die Metadaten-Datei {!r}."
-#: lib/webhooks/get_forge_modules.py:318
+#: lib/webhooks/get_forge_modules.py:321
msgid "Could not interprete {f!r} as a regular JSON file: {e}"
msgstr "Konnte {f!r} nicht als reguläre JSON-Datei interpretieren: {e}"
-#: lib/webhooks/get_forge_modules.py:322
+#: lib/webhooks/get_forge_modules.py:325
msgid "Did not found any data in {!r}."
msgstr "Keine Daten in {!r} gefunden."
-#: lib/webhooks/get_forge_modules.py:331
+#: lib/webhooks/get_forge_modules.py:334
msgid "Reading Puppetfile of environment {!r} ..."
msgstr "Lese Puppetfile von Umgebung {!r} ⋯"
-#: lib/webhooks/get_forge_modules.py:371
+#: lib/webhooks/get_forge_modules.py:376
msgid "Did not found environments in {!r}."
msgstr "Keine Umgebungen in {!r} gefunden."
-#: lib/webhooks/get_forge_modules.py:389
+#: lib/webhooks/get_forge_modules.py:394
msgid "Trying to open {!r} exclusive ..."
msgstr "Versuche, {!r} exklusiv zu öffnen ⋯"
-#: lib/webhooks/get_forge_modules.py:392
+#: lib/webhooks/get_forge_modules.py:397
msgid "Simulation mode, cache file will not be written."
msgstr "Simulations-Modus, Cache-Datei wird nicht geschrieben."
-#: lib/webhooks/get_forge_modules.py:399
+#: lib/webhooks/get_forge_modules.py:404
msgid "Error on creating file {f!r}: {e}"
msgstr "Fehler bim Erstellen der Datei {f!r}: {e}"
-#: lib/webhooks/get_forge_modules.py:429
+#: lib/webhooks/get_forge_modules.py:434
msgid "Renaming {src!r} => {tgt!r}."
msgstr "Umbenennung {src!r} => {tgt!r}."
msgid "Checked at: {}"
msgstr "Überprüft am: {}"
+#: lib/webhooks/module_info.py:101
+msgid "Could not analyze given full module name {!r}."
+msgstr "Konnte den übergebenen kompletten Modulnamen {!r} nicht analysieren."
+
+#: lib/webhooks/module_info.py:119
+msgid ""
+"There must be given a full module name or the base module name and the vendor name (user name on"
+" Puppet Forge)."
+msgstr ""
+"Es muss entweder ein kompletter Modulname oder der Basis-Modulname zusammen mit dem "
+"Anbieternamen (der Nutzername bei Puppet-Forge) angegeben werden."
+
+#: lib/webhooks/module_info.py:348
+msgid "Parameter {p!r} is not of class {e}, but of class {c} instead."
+msgstr "Der Parameter {p!r} gehört nicht zur Klasse {e}, sondern ist statt dessen ein {c}-Objekt."
+
+#: lib/webhooks/module_info.py:386
+msgid "Did not found module name in json."
+msgstr "Modulnamen nicht im JSON gefunden."
+
+#: lib/webhooks/module_info.py:414
+msgid "Did not found module name in data."
+msgstr "Modulnamen nicht in den Daten gefunden."
+
+#: lib/webhooks/module_info.py:528
+msgid "Could not analyze definitions in {!r}."
+msgstr "Konnte Definitionen in {!r} nicht analysieren."
+
+#: lib/webhooks/module_info.py:541
+msgid "Could not analyze definition token {!r}."
+msgstr "Konnte Definitions-Token in {!r} nicht analysieren."
+
+#: lib/webhooks/module_info.py:557
+msgid "Trying to get module {m!r} from Puppet forge {u!r} ..."
+msgstr "Versuche, das Module {m!r} von Puppet-Forge zu holen ⋯"
+
+#: lib/webhooks/module_info.py:579
+msgid "No output for URL {!r}."
+msgstr "Keine Ausgabe unter der URL {!r}."
+
+#: lib/webhooks/module_info.py:603
+msgid "Did not found version of current release of module {}."
+msgstr "Keine Versionsnummer für das aktuelle Release des Moduls {} gefunden."
+
+#: lib/webhooks/module_info.py:610
+msgid "Did not found source information of module {}."
+msgstr "Keine Quell-Infformationen zu Modul {} gefunden."
+
+#: lib/webhooks/module_info.py:612
+msgid "Did not found current release of module {}."
+msgstr "Kein aktuelles Release für Modul {} gefunden."
+
+#: lib/webhooks/module_list.py:47
+msgid "Invalid value type {{!r}} to set, only {} allowed."
+msgstr "Ungültiger Werte-Typ {{!r}} gesetzt, es ist nur {} erlaubt."
+
+#: lib/webhooks/module_list.py:49
+msgid "The key {k!r} must be equal to the full name {n!r} of the module."
+msgstr "Der Schlüssel {k!r} muss identisch mit dem kompletten Namen {n!r} des Moduls sein."
+
+#: lib/webhooks/module_list.py:50
+msgid "None type as key is not allowed."
+msgstr "Ein None-Typ ist als Schlüssel nicht erlaubt."
+
+#: lib/webhooks/module_list.py:51
+msgid "Empty key {!r} is not allowed."
+msgstr "Ein leere Schlüssel is nicht erlaubt."
+
+#: lib/webhooks/module_list.py:52
+msgid "Object {{!r}} is not a {} object."
+msgstr "Das Objekt {{!r}} ist kein {}-Objekt."
+
#: lib/webhooks/show_modules.py:59
msgid "Returns a list with all used Puppet modules."
msgstr "Gibt eine Liste mit allen Puppet-Modulen zurück."
msgstr ""
"Project-Id-Version: puppetmaster_webhooks 1.3.1\n"
"Report-Msgid-Bugs-To: frank.brehm@pixelpark.com\n"
-"POT-Creation-Date: 2019-01-02 11:21+0100\n"
+"POT-Creation-Date: 2019-01-02 18:20+0100\n"
"PO-Revision-Date: 2018-12-28 09:57+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
msgid "Reading metadata files of environment {!r} ..."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:284
+#: lib/webhooks/get_forge_modules.py:287
msgid "Got no module info from directory {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:293
+#: lib/webhooks/get_forge_modules.py:296
msgid "Directory {!r} does not exists."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:297
+#: lib/webhooks/get_forge_modules.py:300
msgid "Path {!r} is not a directory."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:302
+#: lib/webhooks/get_forge_modules.py:305
msgid "Metadatafile {!r} does not exists."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:305
+#: lib/webhooks/get_forge_modules.py:308
msgid "Metadatafile {!r} is not a regular file."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:308
+#: lib/webhooks/get_forge_modules.py:311
msgid "No read access to metadatafile {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:318
+#: lib/webhooks/get_forge_modules.py:321
msgid "Could not interprete {f!r} as a regular JSON file: {e}"
msgstr ""
-#: lib/webhooks/get_forge_modules.py:322
+#: lib/webhooks/get_forge_modules.py:325
msgid "Did not found any data in {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:331
+#: lib/webhooks/get_forge_modules.py:334
msgid "Reading Puppetfile of environment {!r} ..."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:371
+#: lib/webhooks/get_forge_modules.py:376
msgid "Did not found environments in {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:389
+#: lib/webhooks/get_forge_modules.py:394
msgid "Trying to open {!r} exclusive ..."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:392
+#: lib/webhooks/get_forge_modules.py:397
msgid "Simulation mode, cache file will not be written."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:399
+#: lib/webhooks/get_forge_modules.py:404
msgid "Error on creating file {f!r}: {e}"
msgstr ""
-#: lib/webhooks/get_forge_modules.py:429
+#: lib/webhooks/get_forge_modules.py:434
msgid "Renaming {src!r} => {tgt!r}."
msgstr ""
msgid "Checked at: {}"
msgstr ""
+#: lib/webhooks/module_info.py:101
+msgid "Could not analyze given full module name {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:119
+msgid ""
+"There must be given a full module name or the base module name and the vendor name (user name on"
+" Puppet Forge)."
+msgstr ""
+
+#: lib/webhooks/module_info.py:348
+msgid "Parameter {p!r} is not of class {e}, but of class {c} instead."
+msgstr ""
+
+#: lib/webhooks/module_info.py:386
+msgid "Did not found module name in json."
+msgstr ""
+
+#: lib/webhooks/module_info.py:414
+msgid "Did not found module name in data."
+msgstr ""
+
+#: lib/webhooks/module_info.py:528
+msgid "Could not analyze definitions in {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:541
+msgid "Could not analyze definition token {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:557
+msgid "Trying to get module {m!r} from Puppet forge {u!r} ..."
+msgstr ""
+
+#: lib/webhooks/module_info.py:579
+msgid "No output for URL {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:603
+msgid "Did not found version of current release of module {}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:610
+msgid "Did not found source information of module {}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:612
+msgid "Did not found current release of module {}."
+msgstr ""
+
+#: lib/webhooks/module_list.py:47
+msgid "Invalid value type {{!r}} to set, only {} allowed."
+msgstr ""
+
+#: lib/webhooks/module_list.py:49
+msgid "The key {k!r} must be equal to the full name {n!r} of the module."
+msgstr ""
+
+#: lib/webhooks/module_list.py:50
+msgid "None type as key is not allowed."
+msgstr ""
+
+#: lib/webhooks/module_list.py:51
+msgid "Empty key {!r} is not allowed."
+msgstr ""
+
+#: lib/webhooks/module_list.py:52
+msgid "Object {{!r}} is not a {} object."
+msgstr ""
+
#: lib/webhooks/show_modules.py:59
msgid "Returns a list with all used Puppet modules."
msgstr ""
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: puppetmaster_webhooks 1.4.3\n"
+"Project-Id-Version: puppetmaster_webhooks 1.4.4\n"
"Report-Msgid-Bugs-To: frank.brehm@pixelpark.com\n"
-"POT-Creation-Date: 2019-01-02 11:21+0100\n"
+"POT-Creation-Date: 2019-01-02 18:20+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Reading metadata files of environment {!r} ..."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:284
+#: lib/webhooks/get_forge_modules.py:287
msgid "Got no module info from directory {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:293
+#: lib/webhooks/get_forge_modules.py:296
msgid "Directory {!r} does not exists."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:297
+#: lib/webhooks/get_forge_modules.py:300
msgid "Path {!r} is not a directory."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:302
+#: lib/webhooks/get_forge_modules.py:305
msgid "Metadatafile {!r} does not exists."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:305
+#: lib/webhooks/get_forge_modules.py:308
msgid "Metadatafile {!r} is not a regular file."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:308
+#: lib/webhooks/get_forge_modules.py:311
msgid "No read access to metadatafile {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:318
+#: lib/webhooks/get_forge_modules.py:321
msgid "Could not interprete {f!r} as a regular JSON file: {e}"
msgstr ""
-#: lib/webhooks/get_forge_modules.py:322
+#: lib/webhooks/get_forge_modules.py:325
msgid "Did not found any data in {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:331
+#: lib/webhooks/get_forge_modules.py:334
msgid "Reading Puppetfile of environment {!r} ..."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:371
+#: lib/webhooks/get_forge_modules.py:376
msgid "Did not found environments in {!r}."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:389
+#: lib/webhooks/get_forge_modules.py:394
msgid "Trying to open {!r} exclusive ..."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:392
+#: lib/webhooks/get_forge_modules.py:397
msgid "Simulation mode, cache file will not be written."
msgstr ""
-#: lib/webhooks/get_forge_modules.py:399
+#: lib/webhooks/get_forge_modules.py:404
msgid "Error on creating file {f!r}: {e}"
msgstr ""
-#: lib/webhooks/get_forge_modules.py:429
+#: lib/webhooks/get_forge_modules.py:434
msgid "Renaming {src!r} => {tgt!r}."
msgstr ""
msgid "Checked at: {}"
msgstr ""
+#: lib/webhooks/module_info.py:101
+msgid "Could not analyze given full module name {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:119
+msgid ""
+"There must be given a full module name or the base module name and the vendor name (user name on"
+" Puppet Forge)."
+msgstr ""
+
+#: lib/webhooks/module_info.py:348
+msgid "Parameter {p!r} is not of class {e}, but of class {c} instead."
+msgstr ""
+
+#: lib/webhooks/module_info.py:386
+msgid "Did not found module name in json."
+msgstr ""
+
+#: lib/webhooks/module_info.py:414
+msgid "Did not found module name in data."
+msgstr ""
+
+#: lib/webhooks/module_info.py:528
+msgid "Could not analyze definitions in {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:541
+msgid "Could not analyze definition token {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:557
+msgid "Trying to get module {m!r} from Puppet forge {u!r} ..."
+msgstr ""
+
+#: lib/webhooks/module_info.py:579
+msgid "No output for URL {!r}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:603
+msgid "Did not found version of current release of module {}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:610
+msgid "Did not found source information of module {}."
+msgstr ""
+
+#: lib/webhooks/module_info.py:612
+msgid "Did not found current release of module {}."
+msgstr ""
+
+#: lib/webhooks/module_list.py:47
+msgid "Invalid value type {{!r}} to set, only {} allowed."
+msgstr ""
+
+#: lib/webhooks/module_list.py:49
+msgid "The key {k!r} must be equal to the full name {n!r} of the module."
+msgstr ""
+
+#: lib/webhooks/module_list.py:50
+msgid "None type as key is not allowed."
+msgstr ""
+
+#: lib/webhooks/module_list.py:51
+msgid "Empty key {!r} is not allowed."
+msgstr ""
+
+#: lib/webhooks/module_list.py:52
+msgid "Object {{!r}} is not a {} object."
+msgstr ""
+
#: lib/webhooks/show_modules.py:59
msgid "Returns a list with all used Puppet modules."
msgstr ""