From b2ed24d1023f094deb7ce54ab59ca4384db646a5 Mon Sep 17 00:00:00 2001 From: shnavid Date: Fri, 3 Aug 2007 10:27:37 +0000 Subject: version bumped to 1.7-6pre0 fixed gettext messages moved policy.preWork() after plugins.diagnose() cluster diagnose better messages yum diagnose() disabled for now fixed gettext stuff in Makefile git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@326 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/Makefile | 4 ++-- src/lib/sos/plugins/cluster.py | 5 ++++- src/lib/sos/plugins/yum.py | 2 ++ src/lib/sos/policyredhat.py | 10 +++++----- src/locale/ar/LC_MESSAGES/sos.po | 2 +- src/locale/en/LC_MESSAGES/sos.po | 2 +- src/locale/fr/LC_MESSAGES/sos.po | 24 +++++++++++++++++++++++- src/locale/it/LC_MESSAGES/sos.po | 2 +- src/sos.spec | 2 +- src/sosreport | 8 +++++--- 10 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/Makefile b/src/Makefile index 3d0b6920..b1c1d946 100644 --- a/src/Makefile +++ b/src/Makefile @@ -91,7 +91,7 @@ rpm: mo @mv $(TOPDIR)/RPMS/noarch/$(NAME)-$(VERSION)*.rpm $(TOPDIR)/SRPMS/$(NAME)-$(VERSION)*.rpm $(TOPDIR)/SOURCES/$(NAME)-$(VERSION).tar.gz dist/ pot: - python tools/pygettext.py -o locale/sos.pot sosreport + python tools/pygettext.py -o locale/sos.pot sosreport lib/sos/policyredhat.py mo: - python tools/msgfmt.py locale/*/LC_MESSAGES/sos.po + find locale/*/LC_MESSAGES -name sos.po -exec python tools/msgfmt.py {} \; diff --git a/src/lib/sos/plugins/cluster.py b/src/lib/sos/plugins/cluster.py index a996d362..8fc10c93 100644 --- a/src/lib/sos/plugins/cluster.py +++ b/src/lib/sos/plugins/cluster.py @@ -150,7 +150,10 @@ class cluster(sos.plugintools.PluginBase): # check fencing (warn on no fencing) if len(xpathContext.xpathEval("/cluster/clusternodes/clusternode[not(fence/method/device)]")): - self.addDiagnose("one or more nodes have no fencing agent configured") + if self.has_gfs(): + self.addDiagnose("one or more nodes have no fencing agent configured: fencing is required for GFS to work") + else: + self.addDiagnose("one or more nodes have no fencing agent configured: the cluster infrastructure might not work as intended") # check fencing (warn on manual) if len(xpathContext.xpathEval("/cluster/clusternodes/clusternode[/cluster/fencedevices/fencedevice[@agent='fence_manual']/@name=fence/method/device/@name]")): diff --git a/src/lib/sos/plugins/yum.py b/src/lib/sos/plugins/yum.py index 16347763..1f389d30 100644 --- a/src/lib/sos/plugins/yum.py +++ b/src/lib/sos/plugins/yum.py @@ -27,6 +27,8 @@ class yum(sos.plugintools.PluginBase): return False def diagnose(self): + # FIXME: diagnose should only report actual problems, disabling this for now. + return True # repo sanity checking # TODO: elaborate/validate actual repo files, however this directory should # be empty on RHEL 5+ systems. diff --git a/src/lib/sos/policyredhat.py b/src/lib/sos/policyredhat.py index 89414b86..13368e2f 100755 --- a/src/lib/sos/policyredhat.py +++ b/src/lib/sos/policyredhat.py @@ -124,12 +124,12 @@ class SosPolicy: localname = commands.getoutput("/bin/uname -n").split(".")[0] try: - self.reportName = raw_input("Please enter your first initial and last name [%s]: " % localname) + self.reportName = raw_input(_("Please enter your first initial and last name [%s]: ") % localname) self.reportName = re.sub(r"[^a-zA-Z.0-9]", "", self.reportName) if len(self.reportName) == 0: self.reportName = localname - self.ticketNumber = raw_input("Please enter the case number that you are generating this report for: ") + self.ticketNumber = raw_input(_("Please enter the case number that you are generating this report for: ")) self.ticketNumber = re.sub(r"[^0-9]", "", self.ticketNumber) print except KeyboardInterrupt: @@ -182,12 +182,12 @@ class SosPolicy: fp.close() sys.stdout.write("\n") - print "Your sosreport has been generated and saved in:\n %s" % tarballName + print _("Your sosreport has been generated and saved in:\n %s") % tarballName print if md5out: - print "The md5sum is: " + md5out + print _("The md5sum is: ") + md5out print - print "Please send this file to your support representative." + print _("Please send this file to your support representative.") sys.stdout.write("\n") return diff --git a/src/locale/ar/LC_MESSAGES/sos.po b/src/locale/ar/LC_MESSAGES/sos.po index 91908f9b..8548871e 100644 --- a/src/locale/ar/LC_MESSAGES/sos.po +++ b/src/locale/ar/LC_MESSAGES/sos.po @@ -24,7 +24,7 @@ msgid "plugin %s does not validate, skipping" msgstr "الملحق %s غير سليم، تم تعطيله" #: sosreport:392 -msgid "plug %s skipped (--skip-plugins)" +msgid "plugin %s skipped (--skip-plugins)" msgstr "تم تعطيل الملحق %s عبر --skip-plugins" #: sosreport:396 diff --git a/src/locale/en/LC_MESSAGES/sos.po b/src/locale/en/LC_MESSAGES/sos.po index d65c8f78..9f608ee5 100644 --- a/src/locale/en/LC_MESSAGES/sos.po +++ b/src/locale/en/LC_MESSAGES/sos.po @@ -24,7 +24,7 @@ msgid "plugin %s does not validate, skipping" msgstr "" #: sosreport:421 -msgid "plug %s skipped (--skip-plugins)" +msgid "plugin %s skipped (--skip-plugins)" msgstr "" #: sosreport:425 diff --git a/src/locale/fr/LC_MESSAGES/sos.po b/src/locale/fr/LC_MESSAGES/sos.po index 5ed0789f..56902948 100644 --- a/src/locale/fr/LC_MESSAGES/sos.po +++ b/src/locale/fr/LC_MESSAGES/sos.po @@ -14,6 +14,28 @@ msgstr "" "Content-Transfer-Encoding: utf-8\n" "Generated-By: pygettext.py 1.5\n" +#: lib/sos/policyredhat.py:127 +msgid "Please enter your first initial and last name [%s]: " +msgstr "Prière d'entrer votre première initiale et votre nom [%s]: " + +#: lib/sos/policyredhat.py:132 +msgid "Please enter the case number that you are generating this report for: " +msgstr "Prière de donner le numéro de ticket pour lequel vous avez généré ce rapport: " + +#: lib/sos/policyredhat.py:185 +msgid "" +"Your sosreport has been generated and saved in:\n" +" %s" +"Votre sosreport a été généré et copié dans:\n" +" %s" + +#: lib/sos/policyredhat.py:188 +msgid "The md5sum is: " +msgstr "La somme md5sum est: " + +#: lib/sos/policyredhat.py:190 +msgid "Please send this file to your support representative." +msgstr "Prière d'envoyer ce rapport à votre représentant de Support." #: sosreport:370 msgid "sosreport (version %s)" @@ -24,7 +46,7 @@ msgid "plugin %s does not validate, skipping" msgstr "plugin %s ne s'applique pas, desactivé" #: sosreport:392 -msgid "plug %s skipped (--skip-plugins)" +msgid "plugin %s skipped (--skip-plugins)" msgstr "plugin %s desactivé (--skip-plugins)" #: sosreport:396 diff --git a/src/locale/it/LC_MESSAGES/sos.po b/src/locale/it/LC_MESSAGES/sos.po index 2e68c9fe..965d9a2b 100644 --- a/src/locale/it/LC_MESSAGES/sos.po +++ b/src/locale/it/LC_MESSAGES/sos.po @@ -48,7 +48,7 @@ msgid "plugin %s does not validate, skipping" msgstr "la plugin %s non é valida e verrà ignorata" #: sosreport:394 -msgid "plug %s skipped (--skip-plugins)" +msgid "plugin %s skipped (--skip-plugins)" msgstr "plugin %s disattivata (--skip-plugins)" #: sosreport:398 diff --git a/src/sos.spec b/src/sos.spec index bc9d6b8d..4f565572 100644 --- a/src/sos.spec +++ b/src/sos.spec @@ -2,7 +2,7 @@ %define name sos %define version 1.7 -%define release 5 +%define release 6pre0 %define _localedir %_datadir/locale diff --git a/src/sosreport b/src/sosreport index 302373ae..76fc8206 100755 --- a/src/sosreport +++ b/src/sosreport @@ -374,6 +374,8 @@ def sosreport(): plugins = os.listdir(pluginpath) plugins.sort() + # FIXME: should at least print a warning if the user references a plugin which does not exist + # validate and load plugins for plug in plugins: plugbase = plug[:-3] @@ -389,7 +391,7 @@ def sosreport(): skippedplugins.append((plugbase, pluginClass(plugbase, commons))) continue if plugbase in __cmdLineOpts__.noplugins: - soslog.log(logging.VERBOSE, _("plug %s skipped (--skip-plugins)") % plugbase) + soslog.log(logging.VERBOSE, _("plugin %s skipped (--skip-plugins)") % plugbase) skippedplugins.append((plugbase, pluginClass(plugbase, commons))) continue if not pluginClass(plugbase, commons).checkenabled() and not plugbase in __cmdLineOpts__.enableplugins and not plugbase in __cmdLineOpts__.onlyplugins: @@ -539,8 +541,6 @@ Press ENTER to continue, or CTRL-C to quit. print sys.exit(0) - policy.preWork() - # Call the diagnose() method for each plugin tmpcount = 0 for plugname, plug in loadedplugins: @@ -579,6 +579,8 @@ Press ENTER to continue, or CTRL-C to quit. print sys.exit(0) + policy.preWork() + # Call the setup() method for each plugin for plugname, plug in loadedplugins: soslog.log(logging.VERBOSE2, "Preloading files and commands to be gathered by plugin %s" % plugname) -- cgit