Show
Ignore:
Timestamp:
05/12/10 14:10:28 (21 months ago)
Author:
Frederic Lepied <frederic.lepied@…>
Children:
36e3187115d175e2667c28737fdaccbd1fed1723
Parents:
a37e6686ba85de9cf2e143a6485dd63bceff9404
git-committer:
Frederic Lepied <frederic.lepied@…> (05/12/10 14:10:28)
Message:

allow to use IP addresses and sub-adresses instead of mac addresses

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pxe/addsystem

    ra37e668 r73db309  
    1515from pxe.common import * 
    1616 
    17 if len(sys.argv) < 2: 
     17if len(sys.argv) < 3: 
    1818    error('Usage: %s <system name> <MAC> [<MAC2>...]' % sys.argv[0]) 
    1919 
     
    2828 
    2929for addr in sys.argv[2:]: 
    30     a = simplify_mac(addr) 
     30    if addr.index('.') >= 0: 
     31        a = simplify_ip(addr) 
     32    else: 
     33        a = simplify_mac(addr) 
    3134    try: 
    3235        mac = MacAddress.objects.get(mac=a)