git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1.3 move bonfire.py code to sfa/bonfire repository
[sfa.git]
/
sfa
/
client
/
sfi.py
diff --git
a/sfa/client/sfi.py
b/sfa/client/sfi.py
index
213f755
..
8aec7c1
100644
(file)
--- a/
sfa/client/sfi.py
+++ b/
sfa/client/sfi.py
@@
-14,6
+14,7
@@
import codecs
import pickle
import json
import shutil
import pickle
import json
import shutil
+
from lxml import etree
from StringIO import StringIO
from optparse import OptionParser
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 -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'
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):
"""
) # 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
# 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={}
# (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
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(
arg
s,key)
+ if hasattr(
options,key) and getattr(options,key) is not None
:
+ value=getattr(
option
s,key)
else:
full_key="MYSLICE_" + key.upper()
value=getattr(self.config_instance,full_key,None)
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
# (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'],
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
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))
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
# 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