solve conflicts
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 27 Oct 2011 20:16:07 +0000 (22:16 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 27 Oct 2011 20:16:07 +0000 (22:16 +0200)
sfa/managers/aggregate_manager.py
sfa/plc/vlink.py
sfa/rspecs/elements/versions/pgv2Link.py
sfa/rspecs/versions/sfav1.py
sfa/server/sfaapi.py
sfa/server/threadedserver.py
sfa/util/xml.py

index 2e56a49..20db05c 100644 (file)
@@ -15,7 +15,7 @@ from sfa.rspecs.version_manager import VersionManager
 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
 
index 8aeee49..73ebae7 100644 (file)
@@ -1,5 +1,5 @@
 
-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
@@ -94,7 +94,7 @@ class VLink:
 
     @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
index cbe5861..e39ef35 100644 (file)
@@ -117,6 +117,6 @@ class PGv2Link:
     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           
index 3f36e50..c3bb208 100644 (file)
@@ -117,7 +117,7 @@ class SFAv1(BaseVersion):
         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()
index 87f7935..1c46257 100644 (file)
@@ -4,15 +4,15 @@ import datetime
 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): 
index b9b3ba5..7a9c368 100644 (file)
@@ -21,6 +21,7 @@ from sfa.util.config import Config
 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
 
index 06d61c9..78e4c6a 100755 (executable)
@@ -55,14 +55,13 @@ class XML:
         # 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():