def _get_account_policy_data_value(name, key):
 cmd = 'dscl . -readpl /Users/{0} accountPolicyData {1}'.format(name, key)
 try:
  ret = salt.utils.mac_utils.execute_return_result(cmd)
 except CommandExecutionError as exc:
  if ('eDSUnknownNodeName' in exc.strerror):
   raise CommandExecutionError('User not found: {0}'.format(name))
  raise CommandExecutionError('Unknown error: {0}'.format(exc.strerror))
 return ret

def _get_account_policy_data_value ( name , key ) : cmd = 'dscl . -readpl /Users/{0} accountPolicyData {1}' . format ( name , key ) try : ret = salt . utils . mac_utils . execute_return_result ( cmd ) except CommandExecutionError as exc : if ( 'eDSUnknownNodeName' in exc . strerror ) : raise CommandExecutionError ( 'User not found: {0}' . format ( name ) ) raise CommandExecutionError ( 'Unknown error: {0}' . format ( exc . strerror ) ) return ret
return the value for a key in the accountpolicy section of the users plist file .