#NEWLINE# def has_root( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . execute ( 'ls /' , as_root = True ) #NEWLINE# return True #NEWLINE# #UNINDENT# except DeviceError as e : #NEWLINE# #INDENT# if ( 'not in the sudoers file' not in e . message ) : #NEWLINE# #INDENT# raise self #NEWLINE# #UNINDENT# return False