Changeset 168 for trunk/src


Ignore:
Timestamp:
08/19/09 09:51:32 (15 years ago)
Author:
bas
Message:

Added a common module for daemon and client:

  • src/pxe_global.py.in

src/pxeconfig.py:

  • removed some statements that are moved to pxe_global.py.in
Location:
trunk/src
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/pxeconfig.py

    r167 r168  
    5858import getopt
    5959import socket
    60 import ConfigParser
     60#import ConfigParser
    6161import re
    6262
    6363# import from the sara_python_modules
    6464import AdvancedParser
    65 import pxe_global
     65from pxe_global import *
    6666
    6767# Constants
     
    226226                cnet = string.joinfields(net[0:3], '.')
    227227
     228                if options.SCRIPT_HOOK:
     229                        if options.DEBUG or options.DRY_RUN or options.VERBOSE:
     230                                print 'Executing client script hook: %s with arg: %s' %(options.SCRIPT_HOOK, addr)
     231                        if not options.DRY_RUN:
     232                                cmd = '%s %s' %(options.SCRIPT_HOOK, addr)
     233
    228234                haddr = '%s%02X' %(net_2_hex(cnet, options), int(net[3]))
    229 
    230235                manage_links(haddr, options)
    231                
    232236
    233237def add_options(p):
     
    241245                REMOVE  = False,
    242246                VERSION  = False,
     247                SCRIPT_HOOK = False,
    243248        )
    244249
     
    305310                        pass
    306311
     312        # Only check if we have specified an pxeconfig file if we did not
     313        # specify the REMOVE option
     314        #
    307315        if not options.REMOVE:
    308316                if options.filename:
     
    313321                        options.filename = select_pxe_configfile()
    314322
     323        # ...
     324        if settings['client_script_hook']:
     325                options.SCRIPT_HOOK = settings['client_script_hook']
     326
    315327        if options.DEBUG:
    316328                print args, options
     
    323335        #
    324336        global PXE_CONF_DIR
    325        
    326         configfile = '@pxeconfig_conf@'
    327         settings = ReadConfig(configfile)
     337        settings = ReadConfig()
    328338       
    329339        try:
Note: See TracChangeset for help on using the changeset viewer.