def _check_cmdline(data):
 if (not salt.utils.is_linux()):
  return True
 pid = data.get('pid')
 if (not pid):
  return False
 if (not os.path.isdir('/proc')):
  return True
 path = os.path.join('/proc/{0}/cmdline'.format(pid))
 if (not os.path.isfile(path)):
  return False
 try:
  with salt.utils.fopen(path, 'rb') as fp_:
   if ('salt' in fp_.read()):
    return True
 except (OSError, IOError):
  return False

def _check_cmdline ( data ) : if ( not salt . utils . is_linux ( ) ) : return True pid = data . get ( 'pid' ) if ( not pid ) : return False if ( not os . path . isdir ( '/proc' ) ) : return True path = os . path . join ( '/proc/{0}/cmdline' . format ( pid ) ) if ( not os . path . isfile ( path ) ) : return False try : with salt . utils . fopen ( path , 'rb' ) as fp_ : if ( 'salt' in fp_ . read ( ) ) : return True except ( OSError , IOError ) : return False
in some cases where there are an insane number of processes being created on a system a pid can get recycled or assigned to a non-salt process .