Those two minor changes have been found while doing somewhat bigger rewrite, but I'd like to submit them separately, because they're not related to that rewrite.
The first change finally adds meaningful error descriptions, possibly making smaller number of people confused. I personally stumbled upon those errors when *using* beakerlib, so it's not a "will never happen" kind of scenario.
The second one removes useless local TID variable. Probably an unfinished feature to use "debugging" when TESTID is unset (local test run). Since I found no other related code, since this problem is already dealt with in a different way and also since I've rewritten code related to this area, it makes less than no sense to keep this TID local variable without further reasons.
-- jjk
Jiri Jaburek (2): Use meaningful messages for argument parsing errors Remove unused local variable `TID' from rljAddMessage
src/journal.sh | 1 - src/python/journalling.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
Signed-off-by: Jiri Jaburek jjaburek@redhat.com --- src/python/journalling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/python/journalling.py b/src/python/journalling.py index 20dee69..40a41b5 100755 --- a/src/python/journalling.py +++ b/src/python/journalling.py @@ -530,7 +530,7 @@ def dumpJournal(id, type):
def need(args): if None in args: - print "need Blargh!" + print "Specified command is missing a required option" sys.exit(1)
DESCRIPTION = "Wrapper for operations above BeakerLib journal" @@ -552,7 +552,7 @@ optparser.add_option("--type", default=None, dest="type") (options, args) = optparser.parse_args()
if len(args) != 1: - print "Argh Blargh!: %s" % len(args) + print "Non-option arguments present, argc: %s" % len(args) sys.exit(1)
command = args[0]
Signed-off-by: Jiri Jaburek jjaburek@redhat.com --- src/journal.sh | 1 - 1 file changed, 1 deletion(-)
diff --git a/src/journal.sh b/src/journal.sh index 658cd2e..e8b79f4 100644 --- a/src/journal.sh +++ b/src/journal.sh @@ -372,7 +372,6 @@ rljAddMetric(){ }
rljAddMessage(){ - local TID=${TESTID:-"debugging"} $__INTERNAL_JOURNALIST log --id $BEAKERLIB_RUN --message "$1" --severity "$2" }
beakerlib-devel@lists.fedorahosted.org