Changeset 8717fb5f6353d199eb0d5dc240d1fd27657e995c
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r531ce3a
|
r8717fb5
|
|
| 42 | 42 | pxemngr nextboot <name> <profile name> |
| 43 | 43 | |
| | 44 | If you want to assign a default profile to all systems, use the |
| | 45 | reserved system name 'default'. |
| | 46 | |
| 44 | 47 | - run ./manage.py runserver <ip addr>:<port> to have a web server |
| 45 | 48 | waiting for requests to boot locally. You can also configure django |
| … |
… |
|
| 69 | 72 | templating system. By convention, the tests are usinf a suffix of |
| 70 | 73 | .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 |
| | 74 | TESTS_DIR variable. A wait.test must exist and will be sent by the |
| | 75 | server to the target system when no test is available. This wait.test |
| 73 | 76 | must wait for some time and then exit to let the system send a new |
| 74 | 77 | test if needed or send back a new wait.test. |
| … |
… |
|
| 103 | 106 | pxemngr nexttest <system name> <test name> |
| 104 | 107 | |
| 105 | | To display all the tests ran or scheduled for a system, use: |
| | 108 | To display all the tests scheduled for a system, use: |
| 106 | 109 | |
| 107 | 110 | pxemngr dpytest <system name> |
| 108 | 111 | |
| | 112 | *** Web navigation |
| | 113 | |
| | 114 | By pointing your browser to http://<ipaddr>:<port>/, you can navigate |
| | 115 | in the results of the test system. |
-
|
r1f8d77d
|
r8717fb5
|
|
| 18 | 18 | error('Usage: %s <system name> <MAC> [<MAC2>...]' % sys.argv[0]) |
| 19 | 19 | |
| | 20 | if sys.argv[1] == 'default': |
| | 21 | error('default is a reserved name and cannot be used for a system name') |
| | 22 | |
| 20 | 23 | try: |
| 21 | 24 | system = System.objects.get(name=sys.argv[1]) |
-
|
r920e704
|
r8717fb5
|
|
| 50 | 50 | return s |
| 51 | 51 | |
| | 52 | def create_symlink(src, dst): |
| | 53 | if os.path.exists(dst): |
| | 54 | os.unlink(dst) |
| | 55 | os.symlink(src, dst) |
| | 56 | |
| 52 | 57 | def set_next_boot(system, name, abort=True): |
| 53 | 58 | try: |
| … |
… |
|
| 58 | 63 | else: |
| 59 | 64 | raise BootName.DoesNotExist |
| 60 | | |
| | 65 | |
| | 66 | prof = '%s/%s%s' % (settings.PXE_PROFILES, boot_name.name, settings.PXE_SUFFIX) |
| | 67 | |
| 61 | 68 | for m in MacAddress.objects.filter(system=system): |
| 62 | 69 | 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 | |
| 67 | 75 | log = Log(system=system, boot_name=boot_name) |
| 68 | 76 | log.save() |
-
|
r1f8d77d
|
r8717fb5
|
|
| 18 | 18 | if len(sys.argv) != 3: |
| 19 | 19 | error('Usage: %s <system name> <boot name>' % sys.argv[0]) |
| 20 | | |
| | 20 | |
| | 21 | name = sys.argv[1] |
| | 22 | |
| 21 | 23 | try: |
| 22 | | system = System.objects.get(name=sys.argv[1]) |
| | 24 | system = System.objects.get(name=name) |
| 23 | 25 | except 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) |
| 25 | 31 | |
| 26 | 32 | set_next_boot(system, sys.argv[2]) |