Merge branch 'master' of ssh://git.onelab.eu/git/sfa
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 5 Jan 2012 07:46:58 +0000 (08:46 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 5 Jan 2012 07:46:58 +0000 (08:46 +0100)
Makefile
sfa/client/sfascan.py
sfa/client/sfi.py
sfa/clientbin/Makefile [moved from sfa/client/Makefile with 100% similarity]

index 45136a5..a21ce8f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -138,13 +138,15 @@ BINS =    ./config/sfa-config-tty ./config/gen-sfa-cm-config.py \
        ./sfa/importer/sfa-import-plc.py ./sfa/importer/sfa-nuke-plc.py ./sfa/server/sfa-start.py \
        $(CLIENTS)
 
-sync:
+synccheck: 
 ifeq (,$(SSHURL))
-       @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
+       @echo "*sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
        @echo "  e.g. make sync PLC=private.one-lab.org"
        @echo "  or   make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
        @exit 1
-else
+endif
+
+sync: synccheck
        +$(RSYNC) --relative ./sfa/ $(SSHURL)/usr/lib\*/python2.\*/site-packages/
        +$(RSYNC) ./tests/ $(SSHURL)/root/tests-sfa
        +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin/
@@ -152,20 +154,20 @@ else
        +$(RSYNC) ./config/default_config.xml $(SSHURL)/etc/sfa/
        +$(RSYNC) ./sfa/storage/sfa.sql $(SSHURL)/usr/share/sfa/
        $(SSHCOMMAND) exec service sfa restart
-endif
 
 # 99% of the time this is enough
-fastsync:
+fastsync: synccheck
        +$(RSYNC) --relative ./sfa/ $(SSHURL)/usr/lib\*/python2.\*/site-packages/
        $(SSHCOMMAND) exec service sfa restart
 
-clientsync:
+clientsync: synccheck
        +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin/
 
-ricasync:
+ricasync: synccheck
        +$(RSYNC) --relative ./sfa/fd ./sfa/generic/fd.py ./sfa/rspecs/versions/federica.py $(SSHURL)/usr/lib\*/python2.\*/site-packages/
+       $(SSHCOMMAND) exec service sfa restart
 
-.PHONY: sync fastsync clientsync
+.PHONY: synccheck sync fastsync clientsync ricasync
 
 ##########
 CLIENTLIBFILES= \
index fdfa580..946948c 100644 (file)
@@ -135,7 +135,7 @@ class Interface:
         logger.debug("searching in version cache %s"%self.url())
         cached_version = VersionCache().get(self.url())
         if cached_version is not None:
-            logger.info("Retrieved version info from cache")
+            logger.info("Retrieved version info from cache %s"%self.url())
             return cached_version
         ### otherwise let's do the hard work
         # dummy to meet Sfi's expectations for its 'options' field
@@ -147,8 +147,9 @@ class Interface:
         try:
             client=Sfi(options)
             client.read_config()
-            key_file = client.get_key_file()
-            cert_file = client.get_cert_file(key_file)
+            client.bootstrap()
+            key_file = client.private_key
+            cert_file = client.my_gid
             logger.debug("using key %s & cert %s"%(key_file,cert_file))
             url=self.url()
             logger.info('issuing GetVersion at %s'%url)
index d91e7e2..4ff43ac 100644 (file)
@@ -165,7 +165,8 @@ def unique_call_id(): return uuid.uuid4().urn
 
 class Sfi:
     
-    required_options=['verbose',  'debug',  'registry',  'sm',  'auth',  'user']
+    # dirty hack to make this class usable from the outside
+    required_options=['verbose',  'debug',  'registry',  'sm',  'auth',  'user', 'user_private_key']
 
     @staticmethod
     def default_sfi_dir ():
similarity index 100%
rename from sfa/client/Makefile
rename to sfa/clientbin/Makefile