- Timestamp:
- 08/22/12 14:17:15 (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Changelog
r200 r203 1 4.1.0: 2 * Added two new configuration options for pxeconfig.conf file: closes #17 3 - client_script_hook_add : The script that must be run when we create 4 a pxeconfig file for a host(s). This option 5 replaces client_script_hook. 6 - client_script_hook_remove : The script that must be run wehn we remove 7 a pxeconfig file for a host(s) 8 9 Both options are useful for firewall setups. To open/close ports. 10 11 Reported by: Ramon Bastiaans (SARA) 12 Fixed by: Bas van der Vlies 13 1 14 4.0.3: 2 15 * Removed server_args from pxeconfig.xinetd example. Everything is set via -
trunk/debian/changelog
r200 r203 1 pxeconfig (4.1.0-1) stable; urgency=low 2 3 * See Changelog 4 5 -- Bas van der Vlies <bas@sara.nl> Wed, 22 Aug 2012 14:15:57 +0200 6 1 7 pxeconfig (4.0.3-1) stable; urgency=low 2 8 -
trunk/pxeconfig.conf
r193 r203 2 2 ;pxe_config_dir : ./pxelinux.cfg 3 3 ;debug : 0 4 ;client_script_hook : /usr/sara/sbin/pxefirewall-pre-install.sh 5 ;daemon_script_hook : /usr/sara/sbin/pxefirewall-post-install.sh 4 ;client_script_hook_remove : /usr/sara/sbin/pxefirewall-pre-install.sh remove 5 ;client_script_hook_add : /usr/sara/sbin/pxefirewall-pre-install.sh add 6 ;daemon_script_hook : /usr/sara/sbin/pxefirewall-post-install.sh 6 7 7 8 ; Only set it when dynamic ip's are enabled -
trunk/pxeconfig.spec
r200 r203 4 4 5 5 Name: pxeconfig 6 Version: 4. 0.36 Version: 4.1.0 7 7 Release: 1%{?dist} 8 8 License: See LICENSE -
trunk/src/pxeconfig.py
r202 r203 125 125 return files[index-1] 126 126 127 def manage_links(haddr, options):127 def manage_links(haddr, ip_addr, options): 128 128 """ 129 129 Create the links in the PXE_CONF_DIR, … … 141 141 print 'removing %s/%s' %(PXE_CONF_DIR, haddr) 142 142 143 if options.SCRIPT_HOOK_REMOVE and ip_addr: 144 print 'Executing client script hook remove : %s with arg: %s' %(options.SCRIPT_HOOK_REMOVE, ip_addr) 145 143 146 if os.path.exists(haddr) and not options.DRY_RUN: 144 147 os.unlink(haddr) 145 148 146 149 else: 150 147 151 if options.DEBUG or options.DRY_RUN or options.VERBOSE: 148 152 print 'linking %s to %s' %(haddr, pxe_filename) 153 154 if options.SCRIPT_HOOK_ADD and ip_addr: 155 print 'Executing client script hook add : %s with arg: %s' %(options.SCRIPT_HOOK_ADD, ip_addr) 149 156 150 157 if not options.DRY_RUN: … … 152 159 os.unlink(haddr) 153 160 os.symlink(pxe_filename, haddr) 161 162 if options.SCRIPT_HOOK_ADD and ip_addr: 163 cmd = '%s %s' %(options.SCRIPT_HOOK_ADD, ip_addr) 164 os.system(cmd) 154 165 155 166 def net_2_hex(net, options): … … 194 205 cnet = string.joinfields(net[0:3], '.') 195 206 196 if options.SCRIPT_HOOK:197 if options.DEBUG or options.DRY_RUN or options.VERBOSE:198 print 'Executing client script hook: %s with arg: %s' %(options.SCRIPT_HOOK, addr)199 if not options.DRY_RUN:200 cmd = '%s %s' %(options.SCRIPT_HOOK, addr)201 os.system(cmd)202 207 203 208 haddr = '%s%02X' %(net_2_hex(cnet, options), int(net[3])) 204 manage_links(haddr, options)209 manage_links(haddr, addr, options) 205 210 206 211 … … 214 219 215 220 haddr = '01-%s' %(mac_addr.replace(':', '-').lower()) 216 manage_links(haddr, options)221 manage_links(haddr, None, options) 217 222 218 223 def add_options(p): … … 226 231 REMOVE = False, 227 232 VERSION = False, 228 SCRIPT_HOOK = False, 233 SCRIPT_HOOK_ADD = False, 234 SCRIPT_HOOK_REMOVE = False, 229 235 ) 230 236 … … 302 308 options.filename = select_pxe_configfile() 303 309 304 # ... 305 try: 306 options.SCRIPT_HOOK = defaults['client_script_hook'] 310 311 ## This will be obsoleted by client_script_hook_add 312 # 313 try: 314 options.SCRIPT_HOOK_ADD = defaults['client_script_hook'] 315 except KeyError, detail: 316 pass 317 318 try: 319 options.SCRIPT_HOOK_ADD = defaults['client_script_hook_add'] 320 except KeyError, detail: 321 pass 322 323 try: 324 options.SCRIPT_HOOK_REMOVE = defaults['client_script_hook_remove'] 307 325 except KeyError, detail: 308 326 pass
Note: See TracChangeset
for help on using the changeset viewer.