def _dnsmasq_pid_for(dev):
 pid_file = _dhcp_file(dev, 'pid')
 if os.path.exists(pid_file):
  try:
   with open(pid_file, 'r') as f:
    return int(f.read())
  except (ValueError, IOError):
   return None

def _dnsmasq_pid_for ( dev ) : pid_file = _dhcp_file ( dev , 'pid' ) if os . path . exists ( pid_file ) : try : with open ( pid_file , 'r' ) as f : return int ( f . read ( ) ) except ( ValueError , IOError ) : return None
returns the pid for prior dnsmasq instance for a bridge/device .