def can_mount():
 if (os.getuid() != 0):
  logging.debug('Can not use mount: current user is not "root"')
  return False
 if (not has_userland_tool('mount')):
  logging.debug('Can not use mount: missing "mount" tool')
  return False
 utils.system('modprobe iso9660', 10, True)
 if ('iso9660' not in open('/proc/filesystems').read()):
  logging.debug('Can not use mount: lack of iso9660 kernel support')
  return False
 return True

def can_mount ( ) : if ( os . getuid ( ) != 0 ) : logging . debug ( 'Can not use mount: current user is not "root"' ) return False if ( not has_userland_tool ( 'mount' ) ) : logging . debug ( 'Can not use mount: missing "mount" tool' ) return False utils . system ( 'modprobe iso9660' , 10 , True ) if ( 'iso9660' not in open ( '/proc/filesystems' ) . read ( ) ) : logging . debug ( 'Can not use mount: lack of iso9660 kernel support' ) return False return True
test wether the current user can perform a loop mount afaik .