def bsd_jail_id(pid):
 ps_output = call((GET_BSD_JAIL_ID_PS % pid), [])
 if ((len(ps_output) == 2) and (len(ps_output[1].split()) == 1)):
  jid = ps_output[1].strip()
  if jid.isdigit():
   return int(jid)
 os_name = platform.system()
 if (os_name == 'FreeBSD'):
  log.warn(('Unable to get the jail id for process %s.' % pid))
 else:
  log.debug(('bsd_jail_id(%s): jail ids do not exist on %s' % (pid, os_name)))
 return 0

def bsd_jail_id ( pid ) : ps_output = call ( ( GET_BSD_JAIL_ID_PS % pid ) , [ ] ) if ( ( len ( ps_output ) == 2 ) and ( len ( ps_output [ 1 ] . split ( ) ) == 1 ) ) : jid = ps_output [ 1 ] . strip ( ) if jid . isdigit ( ) : return int ( jid ) os_name = platform . system ( ) if ( os_name == 'FreeBSD' ) : log . warn ( ( 'Unable to get the jail id for process %s.' % pid ) ) else : log . debug ( ( 'bsd_jail_id(%s): jail ids do not exist on %s' % ( pid , os_name ) ) ) return 0
gets the jail id for a process .