Following methods are no longer static in iotlabshell / cortexlabshell:
authorSandrine Avakian <sandrine.avakian@inria.fr>
Thu, 14 Nov 2013 14:12:14 +0000 (15:12 +0100)
committerSandrine Avakian <sandrine.avakian@inria.fr>
Thu, 14 Nov 2013 14:12:14 +0000 (15:12 +0100)
- GetKeys
- _sql_get_slice_info
- _sql_get_slice_info_from_user
- GetPeers
- AddSlice
-__add_person_to_db

sfa/cortexlab/cortexlabshell.py
sfa/iotlab/iotlabshell.py

index 94cb7d9..4ce16ee 100644 (file)
@@ -57,8 +57,8 @@ class CortexlabShell():
         """
         return CortexlabShell._MINIMUM_DURATION
 
-    @staticmethod
-    def GetPeers(peer_filter=None ):
+
+    def GetPeers(self, peer_filter=None ):
         """ Gathers registered authorities in SFA DB and looks for specific peer
         if peer_filter is specified.
         :param peer_filter: name of the site authority looked for.
@@ -275,10 +275,7 @@ class CortexlabShell():
         return_node_list = node_list_dict
         return return_node_list
 
-
-
-    @staticmethod
-    def AddSlice(slice_record, user_record):
+    def AddSlice(self, slice_record, user_record):
         """
 
         Add slice to the local cortexlab sfa tables if the slice comes
@@ -392,8 +389,8 @@ class CortexlabShell():
                     delete_failed))
         return delete_failed or True
 
-    @staticmethod
-    def __add_person_to_db(user_dict):
+
+    def __add_person_to_db(self, user_dict):
         """
         Add a federated user straight to db when the user issues a lease
         request with iotlab nodes and that he has not registered with cortexlab
@@ -1026,8 +1023,8 @@ class CortexlabShell():
         #logger.debug("CORTEXLAB_API UpdatePerson EMPTY - DO NOTHING \r\n ")
         #return
 
-    @staticmethod
-    def GetKeys(key_filter=None):
+
+    def GetKeys(self, key_filter=None):
         """Returns a dict of dict based on the key string. Each dict entry
         contains the key id, the ssh key, the user's email and the
         user's hrn.
@@ -1081,10 +1078,7 @@ class CortexlabShell():
         return ret['bool']
 
 
-
-
-    @staticmethod
-    def _sql_get_slice_info(slice_filter):
+    def _sql_get_slice_info(self, slice_filter):
         """
         Get the slice record based on the slice hrn. Fetch the record of the
         user associated with the slice by using joinedload based on the
@@ -1120,8 +1114,8 @@ class CortexlabShell():
         else:
             return None
 
-    @staticmethod
-    def _sql_get_slice_info_from_user(slice_filter):
+
+    def _sql_get_slice_info_from_user(self, slice_filter):
         """
         Get the slice record based on the user recordid by using a joinedload
         on the relationship reg_slices_as_researcher. Format the sql record
index 1bed89c..579f98b 100644 (file)
@@ -57,8 +57,8 @@ class IotlabShell():
         """
         return IotlabShell._MINIMUM_DURATION
 
-    @staticmethod
-    def GetPeers(peer_filter=None ):
+
+    def GetPeers(self, peer_filter=None ):
         """ Gathers registered authorities in SFA DB and looks for specific peer
         if peer_filter is specified.
         :param peer_filter: name of the site authority looked for.
@@ -405,9 +405,7 @@ class IotlabShell():
         return return_node_list
 
 
-
-    @staticmethod
-    def AddSlice(slice_record, user_record):
+    def AddSlice(self, slice_record, user_record):
         """
 
         Add slice to the local iotlab sfa tables if the slice comes
@@ -526,8 +524,8 @@ class IotlabShell():
                     delete_failed))
         return delete_failed or True
 
-    @staticmethod
-    def __add_person_to_db(user_dict):
+
+    def __add_person_to_db(self, user_dict):
         """
         Add a federated user straight to db when the user issues a lease
         request with iotlab nodes and that he has not registered with iotlab
@@ -1107,8 +1105,8 @@ class IotlabShell():
         #logger.debug("IOTLAB_API UpdatePerson EMPTY - DO NOTHING \r\n ")
         #return
 
-    @staticmethod
-    def GetKeys(key_filter=None):
+
+    def GetKeys(self, key_filter=None):
         """Returns a dict of dict based on the key string. Each dict entry
         contains the key id, the ssh key, the user's email and the
         user's hrn.
@@ -1162,10 +1160,7 @@ class IotlabShell():
         return ret['bool']
 
 
-
-
-    @staticmethod
-    def _sql_get_slice_info(slice_filter):
+    def _sql_get_slice_info(self, slice_filter):
         """
         Get the slice record based on the slice hrn. Fetch the record of the
         user associated with the slice by using joinedload based on the
@@ -1201,8 +1196,7 @@ class IotlabShell():
         else:
             return None
 
-    @staticmethod
-    def _sql_get_slice_info_from_user(slice_filter):
+    def _sql_get_slice_info_from_user(self, slice_filter):
         """
         Get the slice record based on the user recordid by using a joinedload
         on the relationship reg_slices_as_researcher. Format the sql record