Merge branch 'master' of ssh://git.onelab.eu/git/sfa
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 25 Oct 2011 16:59:50 +0000 (18:59 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 25 Oct 2011 16:59:50 +0000 (18:59 +0200)
17 files changed:
INSTALL.txt
Makefile
docs/Makefile
setup.py
sfa.spec
sfa/init.d/sfa
sfa/init.d/sfa-cm
sfa/managers/slice_manager.py
sfa/server/aggregate.py
sfa/server/component.py
sfa/server/componentserver.py [moved from sfa/util/componentserver.py with 98% similarity]
sfa/server/interface.py
sfa/server/registry.py
sfa/server/sfa-start.py [moved from sfa/server/sfa-server.py with 99% similarity]
sfa/server/sfaserver.py [moved from sfa/util/server.py with 100% similarity]
sfa/server/slicemgr.py
tools/Makefile

index d748883..cc59ceb 100644 (file)
@@ -63,9 +63,9 @@ This will initialize /etc/sfa/authorities/server.key from /etc/sfa/authorities/p
 This will start Registry, Slice Manager and Aggregate Manager. Your ps command output would look like:
 
 # ps -ef | grep python
-root     24944     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-server.py -r -d
-root     24957     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-server.py -a -d
-root     24970     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-server.py -s -d
+root     24944     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-start.py -r -d
+root     24957     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-start.py -a -d
+root     24970     1  0 May11 ?        00:00:00 /usr/bin/python /usr/bin/sfa-start.py -s -d
 -------
 4) Configure SFA client:
 
index 9466961..e3cd9a4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,7 @@ sfiAddAttribute.py sfiAddSliver.py sfiDeleteAttribute.py sfiDeleteSliver.py sfiL
 sfiListSlivers.py sfadump.py
 
 BINS = ./config/sfa-config-tty ./config/gen-sfa-cm-config.py \
-       ./sfa/plc/sfa-import-plc.py ./sfa/plc/sfa-nuke-plc.py ./sfa/server/sfa-server.py \
+       ./sfa/plc/sfa-import-plc.py ./sfa/plc/sfa-nuke-plc.py ./sfa/server/sfa-start.py \
        $(foreach client,$(CLIENTS),./sfa/client/$(client))
 
 sync:
@@ -138,6 +138,7 @@ else
        +$(RSYNC) ./sfa/ $(SSHURL)/usr/lib\*/python2.\*/site-packages/sfa/
        +$(RSYNC) ./tests/ $(SSHURL)/root/tests-sfa
        +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin
+       +$(RSYNC) ./sfa/init.d/sfa  $(SSHURL)/etc/init.d
        $(SSHCOMMAND) exec service sfa restart
 endif
 
index 463dbaf..5f34949 100644 (file)
@@ -3,7 +3,7 @@ doc:
        pythondoc.py ../sfa/util/certificate.py ../sfa/util/credential.py ../sfa/util/gid.py \
                      ../sfa/util/rights.py ../sfa/util/config.py ../sfa/trust/hierarchy.py \
                      ../sfa/util/record.py ../sfa/util/client.py \
-                     ../sfa/util/server.py 
+                     ../sfa/server/sfaserver.py 
 
        pythondoc.py ../sfa/registry/registry.py ../sfa/registry/import.py \
                      ../sfa/registry/nuke.py
index b10be90..019f535 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ bins = [
     'sfa/plc/sfa-import-plc.py', 
     'sfa/plc/sfa-nuke-plc.py', 
     'sfa/server/sfa-ca.py', 
-    'sfa/server/sfa-server.py', 
+    'sfa/server/sfa-start.py', 
     'sfa/server/sfa-clean-peer-records.py', 
     'sfa/server/sfa_component_setup.py', 
     'sfa/client/sfi.py', 
index 4f10df4..f39ab0e 100644 (file)
--- a/sfa.spec
+++ b/sfa.spec
@@ -121,7 +121,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 # sfa and sfatables depend each other.
-%{_bindir}/sfa-server.py*
+%{_bindir}/sfa-start.py*
 /etc/sfatables/*
 %{python_sitelib}/*
 %{_bindir}/keyconvert.py*
index e2fdb10..08975dc 100755 (executable)
@@ -62,18 +62,18 @@ start() {
     reload
 
     # install peer certs
-    action $"SFA installing peer certs" daemon /usr/bin/sfa-server.py -t -d $OPTIONS 
+    action $"SFA installing peer certs" daemon /usr/bin/sfa-start.py -t -d $OPTIONS 
 
     if [ "$SFA_REGISTRY_ENABLED" -eq 1 ]; then
-        action $"SFA Registry" daemon /usr/bin/sfa-server.py -r -d $OPTIONS
+        action $"SFA Registry" daemon /usr/bin/sfa-start.py -r -d $OPTIONS
     fi
 
     if [ "$SFA_AGGREGATE_ENABLED" -eq 1 ]; then
-        action $"SFA Aggregate" daemon /usr/bin/sfa-server.py -a -d $OPTIONS
+        action $"SFA Aggregate" daemon /usr/bin/sfa-start.py -a -d $OPTIONS
     fi
         
     if [ "$SFA_SM_ENABLED" -eq 1 ]; then
-        action "SFA SliceMgr" daemon /usr/bin/sfa-server.py -s -d $OPTIONS
+        action "SFA SliceMgr" daemon /usr/bin/sfa-start.py -s -d $OPTIONS
     fi
 
     if [ "$SFA_FLASHPOLICY_ENABLED" -eq 1 ]; then
@@ -81,15 +81,15 @@ start() {
     fi
 
     RETVAL=$?
-    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa-server.py
+    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa-start.py
 
 }
 
 stop() {
-    action $"Shutting down SFA" killproc sfa-server.py
+    action $"Shutting down SFA" killproc sfa-start.py
     RETVAL=$?
 
-    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa-server.py
+    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa-start.py
 }
 
 
@@ -99,13 +99,13 @@ case "$1" in
     reload) reload force ;;
     restart) stop; start ;;
     condrestart)
-       if [ -f /var/lock/subsys/sfa-server.py ]; then
+       if [ -f /var/lock/subsys/sfa-start.py ]; then
             stop
             start
        fi
        ;;
     status)
-       status sfa-server.py
+       status sfa-start.py
        RETVAL=$?
        ;;
     *)
index eea507c..cdddf8b 100755 (executable)
@@ -27,7 +27,7 @@ start() {
             echo "Component Mgr"
             # make sure server key (nodes private key) exists first
             init_key
-            /usr/bin/sfa-server.py -c -d $OPTIONS
+            /usr/bin/sfa-start.py -c -d $OPTIONS
         fi
 
         RETVAL=$?
@@ -38,7 +38,7 @@ start() {
 
 stop() {
     echo -n $"Shutting down SFA: "
-    killproc sfa-server.py
+    killproc sfa-start.py
     RETVAL=$?
 
     echo
index d3ce06b..55bbe03 100644 (file)
@@ -1,4 +1,3 @@
-/
 import sys
 import time,datetime
 from StringIO import StringIO
index 59a3e6b..6d7516d 100644 (file)
@@ -1,5 +1,5 @@
 from sfa.util.faults import *
-from sfa.util.server import SfaServer
+from sfa.server.sfaserver import SfaServer
 from sfa.util.xrn import hrn_to_urn
 from sfa.server.interface import Interfaces, Interface
 from sfa.util.config import Config     
index 1dc6652..953b5e7 100644 (file)
@@ -6,7 +6,7 @@ import os
 import time
 import sys
 
-from sfa.util.componentserver import ComponentServer
+from sfa.server.componentserver import ComponentServer
  
 # GeniLight client support is optional
 try:
similarity index 98%
rename from sfa/util/componentserver.py
rename to sfa/server/componentserver.py
index 98373ec..8596977 100644 (file)
@@ -21,7 +21,7 @@ from sfa.trust.certificate import Keypair, Certificate
 from sfa.trust.credential import *
 from sfa.util.faults import *
 from sfa.plc.api import ComponentAPI 
-from sfa.util.server import verify_callback, ThreadedServer 
+from sfa.server.sfaserver import verify_callback, ThreadedServer 
 
 
 ##
index dbc8ef2..1ecee51 100644 (file)
@@ -1,13 +1,6 @@
-import traceback
-import os.path
-
 from sfa.util.faults import *
 from sfa.util.storage import XmlStorage
-from sfa.util.xrn import get_authority, hrn_to_urn
-from sfa.util.record import SfaRecord
 import sfa.util.xmlrpcprotocol as xmlrpcprotocol
-import sfa.util.soapprotocol as soapprotocol
-from sfa.trust.gid import GID
 
 # GeniLight client support is optional
 try:
@@ -15,10 +8,11 @@ try:
 except ImportError:
     GeniClientLight = None            
 
-
-
 class Interface:
-    
+    """
+    Interface to another SFA service, typically a peer, or the local aggregate
+    can retrieve a xmlrpclib.ServerProxy object for issuing calls there
+    """
     def __init__(self, hrn, addr, port, client_type='sfa'):
         self.hrn = hrn
         self.addr = addr
index b254811..b55f9ac 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Registry is a SfaServer that implements the Registry interface
 #
-from sfa.util.server import SfaServer
+from sfa.server.sfaserver import SfaServer
 from sfa.util.faults import *
 from sfa.util.xrn import hrn_to_urn
 from sfa.server.interface import Interfaces, Interface
similarity index 99%
rename from sfa/server/sfa-server.py
rename to sfa/server/sfa-start.py
index fadb1d3..379c72d 100755 (executable)
@@ -256,7 +256,7 @@ def update_cert_records(gids):
         
 def main():
     # Generate command line parser
-    parser = OptionParser(usage="sfa-server [options]")
+    parser = OptionParser(usage="sfa-start.py [options]")
     parser.add_option("-r", "--registry", dest="registry", action="store_true",
          help="run registry server", default=False)
     parser.add_option("-s", "--slicemgr", dest="sm", action="store_true",
similarity index 100%
rename from sfa/util/server.py
rename to sfa/server/sfaserver.py
index c0fbd6a..9a7fa4a 100644 (file)
@@ -2,7 +2,7 @@ import os
 import sys
 import datetime
 import time
-from sfa.util.server import *
+from sfa.server.sfaserver import SfaServer
 
 class SliceMgr(SfaServer):
 
index 63bb765..010f019 100644 (file)
@@ -6,7 +6,7 @@ all:deps
 deps: server.png client.png
 
 server.dg: $(DEPTOOLS)
-       py2depgraph.py ../sfa/server/sfa-server.py > $@
+       py2depgraph.py ../sfa/server/sfa-start.py > $@
 
 client.dg: $(DEPTOOLS)
        py2depgraph.py ../sfa/client/sfi.py > $@