<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> import logging <EOL> import salt . utils <EOL> import salt . utils . decorators as decorators <EOL> log = logging . getLogger ( __name__ ) <EOL> __func_alias__ = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> __virtualname__ = '<STR_LIT>' <EOL> def __virtual__ ( ) : <EOL> '''<STR_LIT>''' <EOL> if salt . utils . is_windows ( ) : <EOL> return ( False , ( '<STR_LIT>' <EOL> '<STR_LIT>' . format ( __virtualname__ ) ) ) <EOL> elif not salt . utils . which ( '<STR_LIT>' ) : <EOL> return ( False , ( '<STR_LIT>' <EOL> '<STR_LIT>' . format ( __virtualname__ ) ) ) <EOL> return __virtualname__ <EOL> def tune ( device , ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> salt . utils . warn_until ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> return __salt__ [ '<STR_LIT>' ] ( device , ** kwargs ) <EOL> @ decorators . which ( '<STR_LIT>' ) <EOL> def wipe ( device ) : <EOL> '''<STR_LIT>''' <EOL> salt . utils . warn_until ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> return __salt__ [ '<STR_LIT>' ] ( device ) <EOL> def dump ( device , args = None ) : <EOL> '''<STR_LIT>''' <EOL> salt . utils . warn_until ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> return __salt__ [ '<STR_LIT>' ] ( device , args ) <EOL> @ decorators . which ( '<STR_LIT>' ) <EOL> @ decorators . which ( '<STR_LIT>' ) <EOL> def format_ ( device , fs_type = '<STR_LIT>' , <EOL> inode_size = None , lazy_itable_init = None , force = False ) : <EOL> '''<STR_LIT>''' <EOL> cmd = [ '<STR_LIT>' , '<STR_LIT>' , str ( fs_type ) ] <EOL> if inode_size is not None : <EOL> if fs_type [ : <NUM_LIT:3> ] == '<STR_LIT>' : <EOL> cmd . extend ( [ '<STR_LIT>' , str ( inode_size ) ] ) <EOL> elif fs_type == '<STR_LIT>' : <EOL> cmd . extend ( [ '<STR_LIT>' , '<STR_LIT>' . format ( inode_size ) ] ) <EOL> if lazy_itable_init is not None : <EOL> if fs_type [ : <NUM_LIT:3> ] == '<STR_LIT>' : <EOL> cmd . extend ( [ '<STR_LIT>' , '<STR_LIT>' . format ( lazy_itable_init ) ] ) <EOL> if force : <EOL> if fs_type [ : <NUM_LIT:3> ] == '<STR_LIT>' : <EOL> cmd . append ( '<STR_LIT>' ) <EOL> elif fs_type == '<STR_LIT>' : <EOL> cmd . append ( '<STR_LIT>' ) <EOL> cmd . append ( str ( device ) ) <EOL> mkfs_success = __salt__ [ '<STR_LIT>' ] ( cmd , ignore_retcode = True ) == <NUM_LIT:0> <EOL> sync_success = __salt__ [ '<STR_LIT>' ] ( '<STR_LIT>' , ignore_retcode = True ) == <NUM_LIT:0> <EOL> return all ( [ mkfs_success , sync_success ] ) <EOL> @ decorators . which_bin ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def fstype ( device ) : <EOL> '''<STR_LIT>''' <EOL> if salt . utils . which ( '<STR_LIT>' ) : <EOL> lsblk_out = __salt__ [ '<STR_LIT>' ] ( '<STR_LIT>' . format ( device ) ) . splitlines ( ) <EOL> if len ( lsblk_out ) > <NUM_LIT:1> : <EOL> fs_type = lsblk_out [ <NUM_LIT:1> ] . strip ( ) <EOL> if fs_type : <EOL> return fs_type <EOL> if salt . utils . which ( '<STR_LIT>' ) : <EOL> df_out = __salt__ [ '<STR_LIT>' ] ( '<STR_LIT>' . format ( device ) ) . splitlines ( ) <EOL> if len ( df_out ) > <NUM_LIT:1> : <EOL> fs_type = df_out [ <NUM_LIT:1> ] <EOL> if fs_type : <EOL> return fs_type <EOL> return '<STR_LIT>' <EOL> @ decorators . which ( '<STR_LIT>' ) <EOL> def resize2fs ( device ) : <EOL> '''<STR_LIT>''' <EOL> salt . utils . warn_until ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> return __salt__ [ '<STR_LIT>' ] ( device ) </s>
