Skip to content

Commit

Permalink
Fix riak-version urls from local to config values
Browse files Browse the repository at this point in the history
  • Loading branch information
platon committed Nov 10, 2016
1 parent 05800b2 commit 4a6926f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/rms_resources.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

-export([init_artifacts/4,
artifact_urls/2,
riak_artifact_urls/1,
riak_urls/1,
riak_root_path/2]).

-define(EXCLUDE_ARTIFACT_KEYS, ["scheduler"]).
Expand Down Expand Up @@ -56,9 +56,9 @@ artifact_urls(BaseUrl, ResourceUrls) ->
Artifacts = artifacts(ResourceUrls),
[{Key, BaseUrl ++ Package} || {Key, Package} <- Artifacts].

-spec riak_artifact_urls([{string(), string()}]) -> [{string(), string()}].
riak_artifact_urls(ArtifactUrls) ->
[ArtifactUrl || {Key, _Url} = ArtifactUrl <- ArtifactUrls,
-spec riak_urls([{string(), string()}]) -> [{string(), string()}].
riak_urls(ResourceUrls) ->
[ResourceUrl || {Key, _Url} = ResourceUrl <- ResourceUrls,
case Key of
"riak-" ++ _Version ->
true;
Expand Down
12 changes: 6 additions & 6 deletions src/rms_wm_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

-module(rms_wm_helper).

-export([riak_artifact_urls/0,
-export([riak_urls/0,
cluster_exists/1,
cluster_riak_config_exists/1,
cluster_advanced_config_exists/1,
Expand Down Expand Up @@ -56,10 +56,10 @@

%% External functions.

-spec riak_artifact_urls() -> [{string(), string()}].
riak_artifact_urls() ->
{ok, ArtifactUrls} = rms_metadata:get_option(artifact_urls),
rms_resources:riak_artifact_urls(ArtifactUrls).
-spec riak_urls() -> [{string(), string()}].
riak_urls() ->
ResourceUrls = rms_config:resource_urls(),
rms_resources:riak_urls(ResourceUrls).

-spec cluster_exists(rms_cluster:key()) -> boolean().
cluster_exists(ClusterKey) ->
Expand Down Expand Up @@ -214,7 +214,7 @@ from_json(Value, _Options) ->

-spec validate_riak_version(string()) -> boolean().
validate_riak_version(RiakVersion) ->
case lists:keymember(RiakVersion, 1, riak_artifact_urls()) of
case lists:keymember(RiakVersion, 1, riak_urls()) of
true ->
ok;
false ->
Expand Down
2 changes: 1 addition & 1 deletion src/rms_wm_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static_file(ReqData) ->
%% Riak versions.

riak_versions(ReqData) ->
JsonRiakUrls = rms_wm_helper:to_json(rms_wm_helper:riak_artifact_urls()),
JsonRiakUrls = rms_wm_helper:to_json(rms_wm_helper:riak_urls()),
{[{riak_versions, JsonRiakUrls}], ReqData}.

%% Clusters.
Expand Down

0 comments on commit 4a6926f

Please sign in to comment.