Changeset 130adbe2f7b21a1f7411f4c06867006e259177c4

Show
Ignore:
Timestamp:
11/28/07 18:48:30 (1 year ago)
Author:
Jason Michalski <armooo@armooo.net>
git-committer:
Jason Michalski <armooo@armooo.net> 1196297310 -0600
git-parent:

[d49819f39a81972d744a39a9eea42c63b5b455f4]

git-author:
Jason Michalski <armooo@armooo.net> 1196297310 -0600
Message:

Don't crash without a neteork

Catch the exception if there is no network currently avaliable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • beacon.py

    r8698247 r130adbe  
    2626        beacon.append('identity=%s' % guid) 
    2727 
    28         import socket 
    29         beacon.append('machine=%s' % socket.gethostname()) 
     28        beacon.append('machine=%s' % gethostname()) 
    3029        beacon.append('platform=pc') 
    3130        beacon.append('services=' + self.format_services()) 
     
    3635        beacon_ips = config.getBeaconAddreses() 
    3736        for beacon_ip in beacon_ips.split(): 
    38             self.UDPSock.sendto(self.format_beacon(), (beacon_ip, 2190)) 
     37            try: 
     38                self.UDPSock.sendto(self.format_beacon(), (beacon_ip, 2190)) 
     39            except error: 
     40                pass 
    3941 
    4042    def start(self):