Changeset 25d22ddddfca26a57fa98bf4ffd224765ddc118f for pxe
- Timestamp:
- 02/02/09 19:48:46 (3 years ago)
- Children:
- 1f8d77d22e8dcb5f151e7d1e74900047caf545f8
- Parents:
- 4eb29337239a94a6d28647644c80d1728804f0f9
- git-committer:
- Frederic Lepied <frederic.lepied@…> (02/02/09 19:48:46)
- Files:
-
- 1 modified
-
pxe/dpysystem (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pxe/dpysystem
r2c8d924 r25d22dd 3 3 # Project : pxemngr 4 4 # File : dpysystem 5 # Version : $Id$5 # Copyright : 2009 Splitted-Desktop Systems 6 6 # Author : Frederic Lepied 7 7 # Created On : Sun Feb 1 13:54:41 2009 8 # Purpose : 8 # Purpose : report the list of systems or informations 9 # about one system. 9 10 #--------------------------------------------------------------- 10 11 … … 15 16 16 17 if len(sys.argv) != 2: 17 error('Usage: %s <system name>' % sys.argv[0]) 18 error('Usage: %s <system name>|-l' % sys.argv[0]) 19 20 if sys.argv[1] == '-l': 21 for s in System.objects.all(): 22 print s.name 23 else: 24 try: 25 system = System.objects.get(name=sys.argv[1]) 26 except System.DoesNotExist: 27 error('System %s not defined' % sys.argv[1]) 18 28 19 try: 20 system = System.objects.get(name=sys.argv[1]) 21 except System.DoesNotExist: 22 error('System %s not defined' % sys.argv[1]) 23 24 print 'Name:', system.name 25 26 for mac in MacAddress.objects.filter(system=system): 27 print 'Mac:', 28 for i in range(0, 10, 2): 29 sys.stdout.write('%s:' % mac.mac[i:i+2]) 30 sys.stdout.write('%s\n' % mac.mac[10:12]) 31 32 logs = Log.objects.filter(system=system).order_by('-date') 33 if len(logs) >= 1: 34 print 'Next boot:', logs[0].boot_name.name 35 36 print 'History:' 37 for l in logs[1:]: 38 print l.date, l.boot_name.name 29 print 'Name:', system.name 30 31 for mac in MacAddress.objects.filter(system=system): 32 print 'Mac:', 33 for i in range(0, 10, 2): 34 sys.stdout.write('%s:' % mac.mac[i:i+2]) 35 sys.stdout.write('%s\n' % mac.mac[10:12]) 36 37 logs = Log.objects.filter(system=system).order_by('-date') 38 if len(logs) >= 1: 39 print 'Next boot:', logs[0].boot_name.name 40 41 print 'History:' 42 for l in logs[1:]: 43 print l.date, l.boot_name.name 39 44 40 45 # addsystem ends here
