Changeset eee2b2e for fedd/fedd_config_file.py
- Timestamp:
- Oct 6, 2008 4:00:19 PM (16 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- a97394b
- Parents:
- ea0a821
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_config_file.py
rea0a821 reee2b2e 29 29 "create_experiment_cert_file", "create_experiment_cert_pwd", 30 30 "create_experiment_trusted_certs", "federation_script_dir", 31 "ssh_pubkey_file") 31 "ssh_pubkey_file", "experiment_state_file") 32 id_list_attrs = ("restricted",) 32 33 33 34 … … 43 44 for a in config_file.emulab_attrs + config_file.id_attrs: 44 45 setattr(self, a, None) 46 47 for a in config_file.id_list_attrs: 48 setattr(self, a, []) 45 49 46 50 self.attrs = { } … … 48 52 self.fedid_default = "user" 49 53 self.access = { } 50 self.restricted = []51 54 52 55 if config: … … 144 147 '|'.join(config_file.emulab_attrs + config_file.id_attrs) + \ 145 148 '):\s*(.*)', re.IGNORECASE) 149 list_re = re.compile("(" + '|'.join(config_file.id_list_attrs) + \ 150 "):\s*(.*)", re.IGNORECASE) 146 151 attr_re = re.compile('attribute:\s*([\._\-a-z0-9]+)\s+value:\s*(.*)', 147 152 re.IGNORECASE) … … 150 155 access_name + '\s*\)', re.IGNORECASE) 151 156 trustfile_re = re.compile("trustfile:\s*(.*)", re.IGNORECASE) 152 restricted_re = re.compile("restricted:\s*(.*)", re.IGNORECASE)153 157 154 158 def parse_name(n): … … 177 181 continue 178 182 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 179 192 # Extended (attribute: x value: y) attribute line 180 193 m = attr_re.match(line) … … 206 219 if m != None: 207 220 self.read_trust(m.group(1)) 208 continue209 # Restricted node types210 211 m = restricted_re.match(line)212 if m != None:213 self.restricted.append(m.group(1))214 221 continue 215 222
Note: See TracChangeset
for help on using the changeset viewer.