Merge branch 'master' of ssh://git.onelab.eu/git/sfa
authorMohamed Larabi <mohamed.larabi@inria.fr>
Thu, 10 Oct 2013 10:02:28 +0000 (12:02 +0200)
committerMohamed Larabi <mohamed.larabi@inria.fr>
Thu, 10 Oct 2013 10:02:28 +0000 (12:02 +0200)
1  2 
sfa/client/sfi.py

diff --combined sfa/client/sfi.py
@@@ -477,6 -477,8 +477,8 @@@ use this if you mean an authority inste
                               metavar="slice_hrn", help="delegate cred. for slice HRN")
              parser.add_option("-a", "--auths", dest='delegate_auths',action='append',default=[],
                               metavar='auth_hrn', help="delegate PI cred for auth HRN")
+             parser.add_option('-d', '--delegate', dest='delegate', help="Override 'delegate' from the config file")
+             parser.add_option('-b', '--backend',  dest='backend',  help="Override 'backend' from the config file")
          
          return parser
  
  
              if 'sfa' not in server_version:
                  users = pg_users_arg(user_records)
 -                rspec = RSpec(rspec)
 -                rspec.filter({'component_manager_id': server_version['urn']})
 -                rspec = RSpecConverter.to_pg_rspec(rspec.toxml(), content_type='request')
 +                #rspec = RSpec(rspec)
 +                #rspec.filter({'component_manager_id': server_version['urn']})
 +                #rspec = RSpecConverter.to_pg_rspec(rspec.toxml(), content_type='request')
              else:
                  users = sfa_users_arg(user_records, slice_record)
  
@@@ -1522,8 -1524,14 +1524,14 @@@ $ sfi 
          myslice_dict={}
          myslice_keys=['backend', 'delegate', 'platform', 'username']
          for key in myslice_keys:
-             full_key="MYSLICE_" + key.upper()
-             value=getattr(self.config_instance,full_key,None)
+             value=None
+             # oct 2013 - I'm finding myself juggling with config files
+             # so I'm adding a few command-line options to override config
+             if hasattr(args,key):
+                 value=getattr(args,key)
+             else:
+                 full_key="MYSLICE_" + key.upper()
+                 value=getattr(self.config_instance,full_key,None)
              if value:   myslice_dict[key]=value
              else:       print "Unsufficient config, missing key %s in [myslice] section of sfi_config"%key
          if len(myslice_dict) != len(myslice_keys):