#NEWLINE# def _mount_nfs( self , mount_path , nfs_share , options = None , ensure = False ) : #NEWLINE# #INDENT# 'Mount nfs export to mount path.' #NEWLINE# utils . execute ( 'mkdir' , '-p' , mount_path ) #NEWLINE# nfs_cmd = [ 'mount' , '-t' , 'nfs' ] #NEWLINE# if ( CONF . libvirt . nfs_mount_options is not None ) : #NEWLINE# #INDENT# nfs_cmd . extend ( [ '-o' , CONF . libvirt . nfs_mount_options ] ) #NEWLINE# #UNINDENT# if options : #NEWLINE# #INDENT# nfs_cmd . extend ( options . split ( ' ' ) ) #NEWLINE# #UNINDENT# nfs_cmd . extend ( [ nfs_share , mount_path ] ) #NEWLINE# try : #NEWLINE# #INDENT# utils . execute ( * nfs_cmd , run_as_root = True ) #NEWLINE# #UNINDENT# except processutils . ProcessExecutionError as exc : #NEWLINE# #INDENT# if ( ensure and ( 'already mounted' in six . text_type ( nfs_share ) ) ) : #NEWLINE# #INDENT# LOG . warning ( _LW ( '%s is already mounted' ) , nfs_share ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise