Changeset 13705 in genesis for tools


Ignore:
Timestamp:
Jan 15, 2017, 10:25:04 PM (8 years ago)
Author:
rick
Message:

No dhcp allowed when interface is bridge member.

Added pre-checking validation, since it is an likely canidate for confusing and
committing the duplicates will cause the config files generation to fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13696 r13705  
    219219        datadump[key]['autogen_bridge_member'] = datadump[key].has_key('parent')
    220220        datadump[key]['autogen_bridge'] = datadump[key]['autogen_ifbase'].startswith('bridge')
     221
     222        if datadump[key].has_key('parent'):
     223            if datadump[key].has_key('ip'):
     224                raise ValueError("Interface bridge member cannot have IP assigned")
     225            if datadump[key].has_key('dhcp') and datadump[key]['dhcp'] != False:
     226                raise ValueError("Interface bridge member cannot have DHCP set")
    221227
    222228        if datadump[key].has_key('ip'):
Note: See TracChangeset for help on using the changeset viewer.