def properties(obj, type=None, set=None):
 if (type and (type not in ['s', 'subvol', 'f', 'filesystem', 'i', 'inode', 'd', 'device'])):
  raise CommandExecutionError('Unknown property type: "{0}" specified'.format(type))
 cmd = ['btrfs']
 cmd.append('property')
 cmd.append(((set and 'set') or 'list'))
 if type:
  cmd.append('-t{0}'.format(type))
 cmd.append(obj)
 if set:
  try:
   for (key, value) in [[item.strip() for item in keyset.split('=')] for keyset in set.split(',')]:
    cmd.append(key)
    cmd.append(value)
  except Exception as ex:
   raise CommandExecutionError(ex)
 out = __salt__['cmd.run_all'](' '.join(cmd))
 salt.utils.fsutils._verify_run(out)
 if (not set):
  ret = {}
  for (prop, descr) in six.iteritems(_parse_proplist(out['stdout'])):
   ret[prop] = {'description': descr}
   value = __salt__['cmd.run_all']('btrfs property get {0} {1}'.format(obj, prop))['stdout']
   ret[prop]['value'] = ((value and value.split('=')[(-1)]) or 'N/A')
  return ret

def properties ( obj , type = None , set = None ) : if ( type and ( type not in [ 's' , 'subvol' , 'f' , 'filesystem' , 'i' , 'inode' , 'd' , 'device' ] ) ) : raise CommandExecutionError ( 'Unknown property type: "{0}" specified' . format ( type ) ) cmd = [ 'btrfs' ] cmd . append ( 'property' ) cmd . append ( ( ( set and 'set' ) or 'list' ) ) if type : cmd . append ( '-t{0}' . format ( type ) ) cmd . append ( obj ) if set : try : for ( key , value ) in [ [ item . strip ( ) for item in keyset . split ( '=' ) ] for keyset in set . split ( ',' ) ] : cmd . append ( key ) cmd . append ( value ) except Exception as ex : raise CommandExecutionError ( ex ) out = __salt__ [ 'cmd.run_all' ] ( ' ' . join ( cmd ) ) salt . utils . fsutils . _verify_run ( out ) if ( not set ) : ret = { } for ( prop , descr ) in six . iteritems ( _parse_proplist ( out [ 'stdout' ] ) ) : ret [ prop ] = { 'description' : descr } value = __salt__ [ 'cmd.run_all' ] ( 'btrfs property get {0} {1}' . format ( obj , prop ) ) [ 'stdout' ] ret [ prop ] [ 'value' ] = ( ( value and value . split ( '=' ) [ ( - 1 ) ] ) or 'N/A' ) return ret
retrieves all properties with possible values that can be guessed .