fix options to sfi myslice for selecting a custom backend
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 5 Nov 2013 11:29:07 +0000 (12:29 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 5 Nov 2013 11:31:49 +0000 (12:31 +0100)
sfa/client/sfi.py

index 2f8a2a8..8793da3 100644 (file)
@@ -1493,8 +1493,9 @@ $ sfi myslice
 $ sfi -v myslice  -- or sfi -vv myslice
   same but with more and more verbosity
 
-$ sfi m
+$ sfi m -b http://mymanifold.foo.com:7080/
   is synonym to sfi myslice as no other command starts with an 'm'
+  and uses a custom backend for this one call
 """
 ) # register_command
     def myslice (self, options, args):
@@ -1518,13 +1519,13 @@ $ sfi m
 
         # (a) rain check for sufficient config in sfi_config
         myslice_dict={}
-        myslice_keys=['backend', 'delegate', 'platform', 'username']
+        myslice_keys=[ 'backend', 'delegate', 'platform', 'username']
         for key in myslice_keys:
             value=None
             # oct 2013 - I'm finding myself juggling with config files
             # so a couple of command-line options can now override config
-            if hasattr(args,key):
-                value=getattr(args,key)
+            if hasattr(options,key) and getattr(options,key) is not None:
+                value=getattr(options,key)
             else:
                 full_key="MYSLICE_" + key.upper()
                 value=getattr(self.config_instance,full_key,None)