@decorators.memoize
def selinux_fs_path():
 try:
  for directory in ('/sys/fs/selinux', '/selinux'):
   if os.path.isdir(directory):
    if os.path.isfile(os.path.join(directory, 'enforce')):
     return directory
  return None
 except AttributeError:
  return None

@ decorators . memoize def selinux_fs_path ( ) : try : for directory in ( '/sys/fs/selinux' , '/selinux' ) : if os . path . isdir ( directory ) : if os . path . isfile ( os . path . join ( directory , 'enforce' ) ) : return directory return None except AttributeError : return None
return the location of the selinux vfs directory cli example: .