Changeset 1762a952e611da0797ed6cd822b7429e24f2cf07
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r36e3187
|
r1762a95
|
|
| 3 | 3 | # Project : pxe |
| 4 | 4 | # File : delsystem |
| 5 | | # Version : $Id$ |
| | 5 | # Copyright : 2010 Splitted-Desktop Systems |
| 6 | 6 | # Author : Frederic Lepied |
| 7 | 7 | # Created On : Wed May 12 10:01:29 2010 |
| … |
… |
|
| 11 | 11 | import sys |
| 12 | 12 | from pxe.models import * |
| | 13 | import settings |
| | 14 | from pxe.common import * |
| 13 | 15 | |
| 14 | 16 | if len(sys.argv) != 2: |
| … |
… |
|
| 20 | 22 | error('System %s not defined' % sys.argv[1]) |
| 21 | 23 | |
| | 24 | list = ['%s/%s' % (settings.PXE_ROOT, system.name), ] |
| | 25 | |
| | 26 | for m in MacAddress.objects.filter(system=system): |
| | 27 | list.append(mac2path(m.mac)) |
| | 28 | |
| | 29 | for f in list: |
| | 30 | try: |
| | 31 | os.unlink(f) |
| | 32 | except OSError: |
| | 33 | pass |
| | 34 | |
| 22 | 35 | system.delete() |
| 23 | 36 | |