- Timestamp:
- 04/14/09 14:14:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pxeconfig.in
r131 r132 69 69 import ConfigParser 70 70 import re 71 72 # import from the sara_python_modules 73 from sara import AdvancedParser 71 74 72 75 # Global Variables … … 452 455 453 456 set_padding(binfo[id]) 457 458 def add_options(p): 459 """ 460 add the default options 461 """ 462 p.set_defaults( 463 DEBUG = False, 464 VERBOSE = False, 465 DRY_RUN = False, 466 REMOVE = False, 467 VERSION = False, 468 ) 469 470 p.add_option('-f', '--filename', 471 action = 'store', 472 dest = 'filename', 473 help = 'Specifies which PXE filename must be use' 474 ) 475 476 p.add_option('-r', '--remove', 477 action = 'store_true', 478 dest = 'REMOVE', 479 help = 'Removes the PXE filename for a host(s)' 480 ) 481 482 p.add_option('-V', '--version', 483 action = 'store_true', 484 dest = 'VERSION', 485 help = 'Removes the PXE filename for a host(s)' 486 ) 487 488 489 def new_parser(argv): 490 """ 491 Make use of sara advance parser module 492 """ 493 parser = AdvancedParser.AdvancedParser(version='Version: 3.0.0', usage=__doc__) 494 add_options(parser) 495 496 options, args = parser.parse_args() 497 return (options, args) 498 454 499 455 500 def parse_args(argv, binfo): … … 626 671 base_2_host(new_bootinfo) 627 672 673 674 def new_main(): 675 628 676 def main(): 629 677 # A dictionary holding the boot info … … 658 706 if __name__ == '__main__': 659 707 try: 660 main() 708 new_parser(sys.argv) 709 new_main() 661 710 except PxeConfig, detail: 662 711 print detail
Note: See TracChangeset
for help on using the changeset viewer.