class SwarmDescription(object):
def __init__(self):
- super(SwarmDescription, self).__init__()
+ self.data = ConfigParser.ConfigParser()
def load(self, swarm_config_file):
""" Load configuration file and use ConfigParser.
logger.error("No such file: %s" %swarm_config_file)
text = ''.join(text.split('\t'))
f = StringIO("[%s]\n" % NOSECTION + text)
- self.data = ConfigParser.ConfigParser()
self.data.readfp(f)
def store(self, ini_file):
session_names.remove('swarm')
session_list = []
for session in session_names:
- entry = SessionEntry()
- entry.data = ConfigParser.ConfigParser()
- entry.data.add_section(session)
+ entry = SessionEntry(session)
session_items = dict(self.data.items(session))
for key in session_items:
entry.data.set(session, key, session_items[key])
self.data.set(session_name, 'client_session_id', str(cs_id))
session_entry.data.set(session_name, 'client_session_id', str(cs_id))
-
def get_file_archives(self):
""" Return a list containing all archives from swarm. """
archives = []
return archives
class SessionEntry(object):
- def __init__(self):
- super(SessionEntry, self).__init__()
-
+ def __init__(self, session):
+ self.data = ConfigParser.ConfigParser()
+ self.data.add_section(session)
def get_session(self):
""" Return name of the session. """
class AccessConfig(object):
def __init__(self):
- super(AccessConfig, self).__init__()
+ self.data = ConfigParser.ConfigParser()
def load(self, access_config_file):
""" Load configuration file and use ConfigParser. """
logger.error("No such file: %s" %swarm_config_file)
text = ''.join(text.split('\t'))
f = StringIO(text)
- self.data = ConfigParser.ConfigParser()
self.data.readfp(f)
def store(self, ini_file):