from sfa.rspecs.rspec import RSpec
import sfa.plc.peers as peers
-from sfa.plc.api import PlcSfaApi
+from sfa.plc.plcsfaapi import PlcSfaApi
from sfa.plc.aggregate import Aggregate
from sfa.plc.slices import Slices
-from sfa.util.plxrn import PlXrn
+from sfa.util.xrn import Xrn
# Taken from bwlimit.py
#
# See tc_util.c and http://physics.nist.gov/cuu/Units/binary.html. Be
@staticmethod
def get_interface_id(interface):
- if_name = PlXrn(interface=interface['component_id']).interface_name()
+ if_name = Xrn(interface=interface['component_id']).get_leaf()
node, dev = if_name.split(":")
node_id = int(node.replace("pc", ""))
return node_id
def get_link_requests(xml):
link_requests = []
for link in PGv2Link.get_links(xml):
- if link['client_id']:
+ if link['client_id'] != None:
link_requests.append(link)
return link_requests
return PGv2Link.get_links(self.xml)
def get_link_requests(self):
- return PGv2Link.get_links(self.xml)
+ return PGv2Link.get_link_requests(self.xml)
def get_link(self, fromnode, tonode, network=None):
fromsite = fromnode.getparent()
from sfa.util.faults import SfaAPIError
from sfa.util.config import Config
from sfa.util.cache import Cache
-
from sfa.trust.auth import Auth
from sfa.trust.certificate import Keypair, Certificate
from sfa.trust.credential import Credential
-# this is wrong all right, but temporary
+# this is wrong all right, but temporary, will use generic
from sfa.managers.managerwrapper import ManagerWrapper, import_manager
-
from sfa.server.xmlrpcapi import XmlrpcApi
+import os
+import datetime
####################
class SfaApi (XmlrpcApi):
from sfa.util.cache import Cache
from sfa.trust.certificate import Certificate
from sfa.trust.trustedroots import TrustedRoots
+
# don't hard code an api class anymore here
from sfa.generic import Generic
# set namespaces map
self.namespaces = dict(self.root.nsmap)
if 'default' not in self.namespaces and None in self.namespaces:
+ # If the 'None' exist, then it's pointing to the default namespace. This makes
+ # it hard for us to write xpath queries for the default naemspace because lxml
+ # wont understand a None prefix. We will just associate the default namespeace
+ # with a key named 'default'.
self.namespaces['default'] = self.namespaces[None]
- # If the 'None' exist, then it's pointing to the default namespace. This makes
- # it hard for us to write xpath queries for the default naemspace because lxml
- # wont understand a None prefix. We will just associate the default namespeace
- # with a key named 'default'.
- if None in self.namespaces:
- default_namespace = self.namespaces.pop(None)
- self.namespaces['default'] = default_namespace
+ else:
+ self.namespaces['default'] = 'default'
# set schema
for key in self.root.attrib.keys():