Changeset 8717fb5f6353d199eb0d5dc240d1fd27657e995c

Show
Ignore:
Timestamp:
03/06/09 08:51:45 (3 years ago)
Author:
Frederic Lepied <frederic.lepied@…>
Children:
b451326126ea3236f570cbbf0b9d6ece0d7ca715
Parents:
338d2582dab7c41138f6d9864729bad6779ec41b
git-committer:
Frederic Lepied <frederic.lepied@…> (03/06/09 08:51:45)
Message:

manage the default pxe boot

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • README

    r531ce3a r8717fb5  
    4242pxemngr nextboot <name> <profile name> 
    4343 
     44If you want to assign a default profile to all systems, use the 
     45reserved system name 'default'. 
     46 
    4447- run ./manage.py runserver <ip addr>:<port> to have a web server 
    4548  waiting for requests to boot locally. You can also configure django 
     
    6972templating system. By convention, the tests are usinf a suffix of 
    7073.test. They are stored in the directory set in settings.py under the 
    71 TESTS_DIR variable. A wait.test must exist and will be send by the 
    72 server to the target system when no test are available. This wait.test 
     74TESTS_DIR variable. A wait.test must exist and will be sent by the 
     75server to the target system when no test is available. This wait.test 
    7376must wait for some time and then exit to let the system send a new 
    7477test if needed or send back a new wait.test. 
     
    103106pxemngr nexttest <system name> <test name> 
    104107 
    105 To display all the tests ran or scheduled for a system, use: 
     108To display all the tests scheduled for a system, use: 
    106109 
    107110pxemngr dpytest <system name> 
    108111 
     112*** Web navigation 
     113 
     114By pointing your browser to http://<ipaddr>:<port>/, you can navigate 
     115in the results of the test system. 
  • pxe/addsystem

    r1f8d77d r8717fb5  
    1818    error('Usage: %s <system name> <MAC> [<MAC2>...]' % sys.argv[0]) 
    1919 
     20if sys.argv[1] == 'default': 
     21    error('default is a reserved name and cannot be used for a system name') 
     22     
    2023try: 
    2124    system = System.objects.get(name=sys.argv[1]) 
  • pxe/common.py

    r920e704 r8717fb5  
    5050    return s 
    5151 
     52def create_symlink(src, dst): 
     53    if os.path.exists(dst): 
     54        os.unlink(dst) 
     55    os.symlink(src, dst) 
     56     
    5257def set_next_boot(system, name, abort=True): 
    5358    try: 
     
    5863        else: 
    5964            raise BootName.DoesNotExist 
    60          
     65 
     66    prof = '%s/%s%s' % (settings.PXE_PROFILES, boot_name.name, settings.PXE_SUFFIX) 
     67     
    6168    for m in MacAddress.objects.filter(system=system): 
    6269        dst = '%s/01-%s' % (settings.PXE_ROOT, mac2filename(m.mac)) 
    63         if os.path.exists(dst): 
    64             os.unlink(dst) 
    65         os.symlink('%s/%s%s' % (settings.PXE_PROFILES, boot_name.name, settings.PXE_SUFFIX), 
    66                    dst) 
     70        create_symlink(prof, dst) 
     71         
     72    if system.name == 'default': 
     73        create_symlink(prof, '%s/default' % (settings.PXE_ROOT)) 
     74 
    6775    log = Log(system=system, boot_name=boot_name) 
    6876    log.save() 
  • pxe/nextboot

    r1f8d77d r8717fb5  
    1818if len(sys.argv) != 3: 
    1919    error('Usage: %s <system name> <boot name>' % sys.argv[0]) 
    20      
     20 
     21name = sys.argv[1] 
     22 
    2123try: 
    22     system = System.objects.get(name=sys.argv[1]) 
     24    system = System.objects.get(name=name) 
    2325except System.DoesNotExist: 
    24     error('System %s not defined' % sys.argv[1]) 
     26    if name == 'default': 
     27        system = System(name=name) 
     28        system.save() 
     29    else: 
     30        error('System %s not defined' % name) 
    2531 
    2632set_next_boot(system, sys.argv[2])