- Timestamp:
- Apr 12, 2012, 7:32:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10436 r10455 364 364 for iface_key in datadump['autogen_iface_keys']: 365 365 if not datadump[iface_key].has_key('comment'): 366 datadump[iface_key]['comment'] = none366 datadump[iface_key]['comment'] = None 367 367 output += "## %(interface)s - %(desc)s - %(comment)s\n" % datadump[iface_key] 368 368 … … 411 411 for iface_key in datadump['autogen_iface_keys']: 412 412 if not datadump[iface_key].has_key('comment'): 413 datadump[iface_key]['comment'] = none413 datadump[iface_key]['comment'] = None 414 414 output += "## %(interface)s - %(desc)s - %(comment)s\n" % datadump[iface_key] 415 415 … … 433 433 def generate_rc_conf_local(datadump): 434 434 """ Generate configuration file '/etc/rc.conf.local' """ 435 datadump['autogen_ileiden_enable'] = 'yes' if datadump['ileiden'] else 'no' 435 if not datadump.has_key('ileiden'): 436 datadump['autogen_ileiden_enable'] = False 437 else: 438 datadump['autogen_ileiden_enable'] = datadump['ileiden'] 436 439 437 440 ileiden_proxies = [] … … 479 482 pf_enable="yes" 480 483 pf_rules="/etc/pf.conf" 481 {% if autogen_ileiden_enable == "yes"-%}484 {% if autogen_ileiden_enable -%} 482 485 pf_flags="-D ext_if={{ externalif }} -D int_if={{ internalif }} -D publicnat={80,443}" 483 486 lvrouted_enable="{{ autogen_ileiden_enable }}" … … 1138 1141 datadumps[datadump['autogen_realname']] = datadump 1139 1142 1143 1140 1144 for host,datadump in datadumps.iteritems(): 1145 # Convert all yes and no to boolean values 1146 def fix_boolean(dump): 1147 for key in dump.keys(): 1148 if type(dump[key]) == dict: 1149 dump[key] = fix_boolean(dump[key]) 1150 elif str(dump[key]).lower() == "yes": 1151 dump[key] = True 1152 elif str(dump[key]).lower() == "no": 1153 # Compass richting no (Noord Oost) is valid input 1154 if key != "compass": 1155 dump[key] = False 1156 return dump 1157 datadump = fix_boolean(datadump) 1158 1141 1159 if datadump['rdnap_x'] and datadump['rdnap_y']: 1142 1160 datadump['latitude'], datadump['longitude'] = rdnap.rd2etrs(datadump['rdnap_x'], datadump['rdnap_y'])
Note:
See TracChangeset
for help on using the changeset viewer.