You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2012/03/01 01:10:15 UTC
svn commit: r1295366 -
/incubator/tashi/trunk/src/tashi/client/tashi-client.py
Author: stroucki
Date: Thu Mar 1 01:10:15 2012
New Revision: 1295366
URL: http://svn.apache.org/viewvc?rev=1295366&view=rev
Log:
tashi-client: special bugfix-only commit of tashi-client for stable branch
Modified:
incubator/tashi/trunk/src/tashi/client/tashi-client.py
Modified: incubator/tashi/trunk/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/client/tashi-client.py?rev=1295366&r1=1295365&r2=1295366&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/trunk/src/tashi/client/tashi-client.py Thu Mar 1 01:10:15 2012
@@ -526,6 +526,7 @@ def main():
"""Main function for the client program"""
global INDENT, exitCode, client
exitCode = 0
+ exception = None
INDENT = (os.getenv("INDENT", 4))
if (len(sys.argv) < 2):
usage()
@@ -570,17 +571,30 @@ def main():
if (arg.startswith("--")):
if (arg[2:] in possibleArgs):
(parg, conv, default, required) = possibleArgs[arg[2:]]
- val = conv(args.pop(0))
+ try:
+ val = None
+ lookahead = args[0]
+ if not lookahead.startswith("--"):
+ val = conv(args.pop(0))
+ except:
+ pass
+
if (val == None):
val = default()
vals[parg] = val
continue
+ # somewhat lame, but i don't want to rewrite the fn at this time
+ exception = ValueError("Unknown argument %s" % (arg))
- raise ValueError("Unknown argument %s" % (arg))
+ f = None
+ try:
+ f = extraViews[function][0]
+ except:
+ pass
-
- f = getattr(client, function, None)
+ if (f is None):
+ f = getattr(client, function, None)
try:
if (f is None):