Skip to content

Commit 9d72201

Browse files
committed
added proplist mapping
1 parent 552edb4 commit 9d72201

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/erlcloud_aws.erl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ get_credentials_from_metadata_xform( Creds ) ->
10121012
prop_to_list_defined(<<"SecretAccessKey">>, Creds),
10131013
prop_to_list_defined(<<"Token">>, Creds),
10141014
timestamp_to_gregorian_seconds(
1015-
proplists:get_value(<<"Expiration">>, Creds))} of
1015+
prop_get_value(<<"Expiration">>, Creds))} of
10161016
{Id, Key, Token, GregorianExpire} when is_list(Id), is_list(Key),
10171017
is_list(Token),
10181018
is_integer(GregorianExpire) ->
@@ -1026,11 +1026,16 @@ get_credentials_from_metadata_xform( Creds ) ->
10261026
end.
10271027

10281028
prop_to_list_defined( Name, Props ) ->
1029-
case proplists:get_value( Name, Props ) of
1029+
case prop_get_value( Name, Props ) of
10301030
undefined -> undefined;
10311031
Value when is_binary(Value) -> binary_to_list(Value)
10321032
end.
10331033

1034+
prop_get_value(Name, Props) when is_map(Props) ->
1035+
maps:get(Name, Props, undefined);
1036+
prop_get_value(Name, Props) ->
1037+
proplists:get_value(Name, Props).
1038+
10341039

10351040
-dialyzer({no_return, get_role_credentials/1}).
10361041
-spec get_role_credentials(aws_config()) -> {ok, #role_credentials{}}.

0 commit comments

Comments
 (0)