X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplanetlab%2Ftopology.py;h=8add242a0518ade76874fcaf9cc9afefbca847ae;hb=713d58df0baa1f9739eec9bfa30ceb41d7149e23;hp=cd6036af3ca44bde4749ea34b7687ca22e5b9078;hpb=c4e713b97658195775b8fd147b8ab9dceb785493;p=sfa.git diff --git a/sfa/planetlab/topology.py b/sfa/planetlab/topology.py index cd6036af..8add242a 100644 --- a/sfa/planetlab/topology.py +++ b/sfa/planetlab/topology.py @@ -1,20 +1,21 @@ ## # SFA Topology Info # -# This module holds topology configuration for SFA. It is implemnted as a +# 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"): - set.__init__(self) + def __init__(self, config_file="/etc/sfa/topology"): + set.__init__(self) try: # load the links f = open(config_file, 'r') @@ -24,7 +25,8 @@ class Topology(set): 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) + self.add((tup[0], tup[1])) + except Exception as e: + logger.log_exc( + "Could not find or load the configuration file: %s" % config_file) raise