Changeset b06744b for fedd/federation
- Timestamp:
- Feb 7, 2014 2:53:02 PM (11 years ago)
- Branches:
- master
- Children:
- 5f5ce09
- Parents:
- bea19b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/desktop_access.py
rbea19b7 rb06744b 342 342 port = None 343 343 my_addr = None 344 my_name = None 344 345 for e in top.elements: 345 346 if not isinstance(e, topdl.Computer): continue 346 347 if e.get_attribute('portal') is None: 348 my_name = e.name 347 349 # there should be one interface with one IPv4 address 348 350 if len(e.interface) <1 : … … 369 371 dscript = os.path.join(self.localdir, 'disconnect') 370 372 local_hosts = os.path.join(self.localdir, 'hosts') 373 zebra_conf = os.path.join(self.localdir, 'zebra.conf') 374 ospfd_conf = os.path.join(self.localdir, 'ospfd.conf') 371 375 try: 372 376 f = open(cscript, 'w') … … 393 397 print >>f, 'ifconfig tap0 %s netmask 255.255.255.0 up' % \ 394 398 my_addr 395 self.set_route('10.0.0.0/8', f, exp_peer) 399 # self.set_route('10.0.0.0/8', f, exp_peer) 400 print >>f, '/usr/local/sbin/zebra -d -i -f %s' % zebra_conf 401 print >>f, '/usr/local/sbin/ospfd -d -i -f %s' % ospfd_conf 396 402 f.close() 397 403 os.chmod(cscript, 0755) … … 400 406 print >>f, 'ifconfig tap0 destroy' 401 407 self.unset_route(peer, f) 402 self.unset_route('10.0.0.0/8', f)408 #self.unset_route('10.0.0.0/8', f) 403 409 print >>f, 'mv /etc/hosts.DETER.fedd.hold /etc/hosts' 410 print >>f, 'kill `cat /var/run/ospfd.pid`' 411 print >>f, 'kill `cat /var/run/zebra.pid`' 404 412 f.close() 405 413 os.chmod(dscript, 0755) 414 f = open(zebra_conf, 'w') 415 print >>f, 'hostname %s' % my_name 416 print >>f, 'interface tap0' 417 f.close() 418 os.chmod(zebra_conf, 0644) 419 f = open(ospfd_conf, 'w') 420 print >>f, 'hostname %s' % my_name 421 print >>f, 'router ospf' 422 print >>f, ' redistribute static' 423 print >>f, ' network %s/24 area 0.0.0.2' % my_addr 406 424 except EnvironmentError, e: 407 425 raise service_error(service_error.internal,
Note: See TracChangeset
for help on using the changeset viewer.