Skip to content

Commit

Permalink
Change bucket's data-type from string to binary
Browse files Browse the repository at this point in the history
  • Loading branch information
yosukehara committed Oct 23, 2012
1 parent 9dc5eb1 commit 09154ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/leo_manager_console.erl
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ s3_add_bucket(CmdBody, Option) ->

case string:tokens(binary_to_list(Option), ?COMMAND_DELIMITER) of
[Bucket, AccessKey] ->
leo_s3_bucket:put(list_to_binary(AccessKey), Bucket);
leo_s3_bucket:put(list_to_binary(AccessKey), list_to_binary(Bucket));
_ ->
{error, ?ERROR_INVALID_ARGS}
end.
Expand Down
8 changes: 5 additions & 3 deletions src/leo_manager_formatter_text.erl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ endpoints(EndPoints) ->
string()).
buckets(Buckets) ->
{Col1Len, Col2Len} = lists:foldl(fun({Bucket, Owner, _}, {C1, C2}) ->
Len1 = length(Bucket),
BucketStr = binary_to_list(Bucket),
Len1 = length(BucketStr),
Len2 = length(Owner),

{case (Len1 > C1) of
Expand All @@ -327,9 +328,10 @@ buckets(Buckets) ->
lists:duplicate(Col3Len, "-"), "\r\n"]),

Fun = fun({Bucket, Owner, Created}, Acc) ->
BucketStr = binary_to_list(Bucket),
Acc ++ io_lib:format("~s | ~s | ~s\r\n",
[string:left(Bucket, Col1Len),
string:left(Owner, Col2Len),
[string:left(BucketStr, Col1Len),
string:left(Owner, Col2Len),
leo_date:date_format(Created)])
end,
lists:append([lists:foldl(Fun, Header, Buckets), "\r\n"]).
Expand Down

0 comments on commit 09154ae

Please sign in to comment.