Show
Ignore:
Timestamp:
05/20/10 15:59:30 (21 months ago)
Author:
Frederic Lepied <frederic.lepied@…>
Children:
865eacece8d4895f3d906bce9125a262b0f1c5ac
Parents:
5a52bd004189f04499c0391d5c6164370ea80fdb
git-committer:
Frederic Lepied <frederic.lepied@…> (05/20/10 15:59:30)
Message:

remove files in PXE_ROOT

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pxe/delsystem

    r36e3187 r1762a95  
    33# Project         : pxe 
    44# File            : delsystem 
    5 # Version         : $Id$ 
     5# Copyright       : 2010 Splitted-Desktop Systems 
    66# Author          : Frederic Lepied 
    77# Created On      : Wed May 12 10:01:29 2010 
     
    1111import sys 
    1212from pxe.models import * 
     13import settings 
     14from pxe.common import * 
    1315 
    1416if len(sys.argv) != 2: 
     
    2022    error('System %s not defined' % sys.argv[1]) 
    2123 
     24list = ['%s/%s' % (settings.PXE_ROOT, system.name), ] 
     25 
     26for m in MacAddress.objects.filter(system=system): 
     27    list.append(mac2path(m.mac)) 
     28 
     29for f in list: 
     30    try: 
     31        os.unlink(f) 
     32    except OSError: 
     33        pass 
     34 
    2235system.delete() 
    2336