X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=sfa%2Fclient%2Fsfi.py;h=8aec7c1e77693f4d5372c610d9c2614c6cecef42;hb=e7605f6cb1ebbdb7cd4c6e7495d58d03aeda863b;hp=213f755dd2941f4645420924ab75c36f3f2a5baf;hpb=86b6e643edae0daff5bd41ad70af09f43f71ac25;p=sfa.git diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index 213f755d..8aec7c1e 100644 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -14,6 +14,7 @@ import codecs import pickle import json import shutil + from lxml import etree from StringIO import StringIO from optparse import OptionParser @@ -1493,8 +1494,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): @@ -1513,15 +1515,18 @@ $ sfi m # enable info by default self.logger.setLevelFromOptVerbose(self.options.verbose+1) ### the rough sketch goes like this + # (0) produce a p12 file + self.client_bootstrap.my_pkcs12() + # (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) @@ -1582,6 +1587,7 @@ $ sfi m # (f) and finally upload them to manifold server # xxx todo add an option so the password can be set on the command line # (but *NOT* in the config file) so other apps can leverage this + self.logger.info("Uploading on backend at %s"%myslice_dict['backend']) uploader = ManifoldUploader (logger=self.logger, url=myslice_dict['backend'], platform=myslice_dict['platform'], @@ -1597,8 +1603,8 @@ $ sfi m if uploader.upload(delegated_credential,message=message): count_success+=1 count_all+=1 - self.logger.info("Successfully uploaded %d/%d credentials"%(count_success,count_all)) + # at first I thought we would want to save these, # like 'sfi delegate does' but on second thought # it is probably not helpful as people would not