Ignore:
Timestamp:
Oct 6, 2008 4:00:19 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
a97394b
Parents:
ea0a821
Message:

save state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_config_file.py

    rea0a821 reee2b2e  
    2929            "create_experiment_cert_file", "create_experiment_cert_pwd",
    3030            "create_experiment_trusted_certs", "federation_script_dir",
    31             "ssh_pubkey_file")
     31            "ssh_pubkey_file", "experiment_state_file")
     32    id_list_attrs = ("restricted",)
    3233
    3334
     
    4344        for a in config_file.emulab_attrs + config_file.id_attrs:
    4445            setattr(self, a, None)
     46       
     47        for a in config_file.id_list_attrs:
     48            setattr(self, a, [])
    4549
    4650        self.attrs = { }
     
    4852        self.fedid_default = "user"
    4953        self.access = { }
    50         self.restricted = []
    5154
    5255        if config:
     
    144147                '|'.join(config_file.emulab_attrs + config_file.id_attrs) + \
    145148                '):\s*(.*)', re.IGNORECASE)
     149        list_re = re.compile("(" + '|'.join(config_file.id_list_attrs) + \
     150                "):\s*(.*)", re.IGNORECASE)
    146151        attr_re = re.compile('attribute:\s*([\._\-a-z0-9]+)\s+value:\s*(.*)',
    147152                re.IGNORECASE)
     
    150155                access_name + '\s*\)', re.IGNORECASE)
    151156        trustfile_re = re.compile("trustfile:\s*(.*)", re.IGNORECASE)
    152         restricted_re = re.compile("restricted:\s*(.*)", re.IGNORECASE)
    153157
    154158        def parse_name(n):
     
    177181                continue
    178182
     183            # List attributes
     184            m = list_re.match(line)
     185            if m != None:
     186                attr, val = m.group(1,2)
     187                l = getattr(self, attr.lower())
     188                l.append(val)
     189                continue
     190
     191
    179192            # Extended (attribute: x value: y) attribute line
    180193            m = attr_re.match(line)
     
    206219            if m != None:
    207220                self.read_trust(m.group(1))
    208                 continue
    209             # Restricted node types
    210 
    211             m = restricted_re.match(line)
    212             if m != None:
    213                 self.restricted.append(m.group(1))
    214221                continue
    215222
Note: See TracChangeset for help on using the changeset viewer.