Merge pull request #8420 from zmstone/0705-refactor-delete-unused-module

chore: delete unused schema module
This commit is contained in:
Zaiming (Stone) Shi 2022-09-05 16:33:07 +02:00 committed by GitHub
commit 9408aeb719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 35 deletions

View File

@ -181,11 +181,15 @@ start_app(App, Handler) ->
app_conf_file(emqx_conf) -> "emqx.conf.all"; app_conf_file(emqx_conf) -> "emqx.conf.all";
app_conf_file(App) -> atom_to_list(App) ++ ".conf". app_conf_file(App) -> atom_to_list(App) ++ ".conf".
%% TODO: get rid of cuttlefish
app_schema(App) -> app_schema(App) ->
Mod = list_to_atom(atom_to_list(App) ++ "_schema"), Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
true = is_list(Mod:roots()), try
Mod. true = is_list(Mod:roots()),
Mod
catch
error:undef ->
no_schema
end.
mustache_vars(App) -> mustache_vars(App) ->
[ [
@ -221,6 +225,8 @@ render_config_file(ConfigFile, Vars0) ->
ok = file:write_file(NewName, Targ), ok = file:write_file(NewName, Targ),
NewName. NewName.
read_schema_configs(no_schema, _ConfigFile) ->
ok;
read_schema_configs(Schema, ConfigFile) -> read_schema_configs(Schema, ConfigFile) ->
NewConfig = generate_config(Schema, ConfigFile), NewConfig = generate_config(Schema, ConfigFile),
lists:foreach( lists:foreach(

View File

@ -1,32 +0,0 @@
%%--------------------------------------------------------------------
%% Copyright (c) 2020-2022 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%--------------------------------------------------------------------
-module(emqx_management_schema).
-include_lib("typerefl/include/types.hrl").
-behaviour(hocon_schema).
-export([
namespace/0,
roots/0,
fields/1
]).
namespace() -> management.
roots() -> [].
fields(_) -> [].