--- /dev/null
+# Links in the physical topology, gleaned from looking at the Internet2
+# topology map. Link (a, b) connects sites with IDs a and b.
+#
+# 2 12 # I2 Princeton - New York
+# 11 13 # I2 Chicago - Wash DC
+# 11 15 # I2 Chicago - Atlanta
+# 11 16 # I2 Chicago - CESNET
+# 11 17 # I2 Chicago - Kansas City
+# 12 13 # I2 New York - Wash DC
+# 13 15 # I2 Wash DC - Atlanta
+# 14 15 # Ga Tech - I2 Atlanta
+# 15 19 # I2 Atlanta - Houston
+# 17 19 # I2 Kansas City - Houston
+# 17 22 # I2 Kansas City - Salt Lake City
+# 17 24 # I2 Kansas City - UMKC
+# 19 20 # I2 Houston - Los Angeles
+# 20 21 # I2 Los Angeles - Seattle
+# 20 22 # I2 Los Angeles - Salt Lake City
+# 21 22 # I2 Seattle - Salt Lake City
+
'config/registries.xml',
'config/default_config.xml',
'config/sfi_config',
+ 'config/topology',
'sfa/managers/pl/pl.rng',
'sfa/trust/credential.xsd',
'sfa/trust/top.xsd',
/etc/sfa/sig.xsd
/etc/sfa/xml.xsd
/etc/sfa/protogeni-rspec-common.xsd
+/etc/sfa/topology
%{_bindir}/sfa-config-tty
%{_bindir}/sfa-import-plc.py*
%{_bindir}/sfa-clean-peer-records.py*
from sfa.util.parameter import Parameter, Mixed
from sfa.util.sfatablesRuntime import run_sfatables
from sfa.trust.credential import Credential
+from sfa.rspecs.rspec import RSpec
class CreateSliver(Method):
"""
chain_name = 'FORWARD-INCOMING'
self.api.logger.debug("CreateSliver: sfatables on chain %s"%chain_name)
rspec = run_sfatables(chain_name, hrn, origin_hrn, rspec)
-
- return self.api.manager.CreateSliver(self.api, slice_xrn, creds, rspec, users, call_id)
+ slivers = RSpec(rspec).version.get_nodes_with_slivers()
+ if slivers:
+ result = self.api.manager.CreateSliver(self.api, slice_xrn, creds, rspec, users, call_id)
+ else:
+ result = rspec
+ return result
from sfa.rspecs.elements.link import Link
from sfa.rspecs.elements.interface import Interface
-from sfa.managers.vini.topology import PhysicalLinks
+from sfa.util.topology import Topology
from sfa.rspecs.version_manager import VersionManager
from sfa.plc.vlink import get_tc_rate
if not self.api.config.SFA_AGGREGATE_TYPE.lower() == 'vini':
return
- for (site_id1, site_id2) in PhysicalLinks:
+ topology = Topology()
+ for (site_id1, site_id2) in topology:
link = Link()
if not site_id1 in self.sites or site_id2 not in self.sites:
continue
--- /dev/null
+##
+# SFA Topology Info
+#
+# This module holds topology configuration for SFA. It is implemnted as a
+# list of site_id tuples
+
+import os.path
+import traceback
+from sfa.util.sfalogging import logger
+
+class Topology(set):
+ """
+ Parse the topology configuration file.
+ """
+
+ #def __init__(self, config_file = "/etc/sfa/topology"):
+ def __init__(self, config_file = "/tmp/topology"):
+ set.__init__(self)
+ self.config_file = None
+ self.config_path = None
+ self.load(config_file)
+
+ def load(self, config_file):
+ try:
+
+ self.config_file = config_file
+ # path to configuration data
+ self.config_path = os.path.dirname(config_file)
+ # load the links
+ f = open(config_file, 'r')
+ for line in f:
+ ignore = line.find('#')
+ if ignore > -1:
+ line = line[0:ignore]
+ tup = line.split()
+ if len(tup) > 1:
+ self.add((tup[0], tup[1]))
+ except Exception, e:
+ logger.log_exc("Could not find or load the configuration file: %s" % config_file)
+ raise