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
removing getNodeManagerShell() method
[sfa.git]
/
sfa
/
plc
/
api.py
diff --git
a/sfa/plc/api.py
b/sfa/plc/api.py
index
5612d89
..
7d5fe83
100644
(file)
--- a/
sfa/plc/api.py
+++ b/
sfa/plc/api.py
@@
-10,7
+10,6
@@
import os
import traceback
import string
import xmlrpclib
import traceback
import string
import xmlrpclib
-
from sfa.trust.auth import Auth
from sfa.util.config import *
from sfa.util.faults import *
from sfa.trust.auth import Auth
from sfa.util.config import *
from sfa.util.faults import *
@@
-19,9
+18,9
@@
from sfa.trust.rights import *
from sfa.trust.credential import *
from sfa.trust.certificate import *
from sfa.util.misc import *
from sfa.trust.credential import *
from sfa.trust.certificate import *
from sfa.util.misc import *
-from sfa.util.sfalogging import *
-from sfa.util.genitable import *
from sfa.util.api import *
from sfa.util.api import *
+from sfa.util.nodemanager import NodeManager
+from sfa.util.sfalogging import *
class GeniAPI(BaseAPI):
class GeniAPI(BaseAPI):
@@
-140,6
+139,7
@@
class GeniAPI(BaseAPI):
if not auth_hrn or hrn == self.config.SFA_INTERFACE_HRN:
auth_hrn = hrn
auth_info = self.auth.get_auth_info(auth_hrn)
if not auth_hrn or hrn == self.config.SFA_INTERFACE_HRN:
auth_hrn = hrn
auth_info = self.auth.get_auth_info(auth_hrn)
+ from sfa.util.genitable import GeniTable
table = GeniTable()
records = table.findObjects(hrn)
if not records:
table = GeniTable()
records = table.findObjects(hrn)
if not records:
@@
-313,6
+313,7
@@
class GeniAPI(BaseAPI):
def fill_record_geni_info(self, record):
geni_info = {}
type = record['type']
def fill_record_geni_info(self, record):
geni_info = {}
type = record['type']
+ from sfa.util.genitable import GeniTable
table = GeniTable()
if (type == "slice"):
person_ids = record.get("person_ids", [])
table = GeniTable()
if (type == "slice"):
person_ids = record.get("person_ids", [])
@@
-380,6
+381,7
@@
class GeniAPI(BaseAPI):
# build a list of the new person ids, by looking up each person to get
# their pointer
newIdList = []
# build a list of the new person ids, by looking up each person to get
# their pointer
newIdList = []
+ from sfa.util.genitable import GeniTable
table = GeniTable()
records = table.find({'type': 'user', 'hrn': newList})
for rec in records:
table = GeniTable()
records = table.find({'type': 'user', 'hrn': newList})
for rec in records:
@@
-429,14
+431,7
@@
class ComponentAPI(BaseAPI):
if config is None:
return
if config is None:
return
- self.nodemanager = self.getNodeManagerShell()
-
- def getNodeManagerShell(self):
- # just import the nm api source
- sys.path.append('/usr/share/NodeManager')
- import api_calls
- return api_calls
-
+ self.nodemanager = NodeManager()
def sliver_exists(self):
sliver_dict = self.nodemanager.GetXIDs()
def sliver_exists(self):
sliver_dict = self.nodemanager.GetXIDs()