diff --git a/applications/acdc/src/acdc_agent_listener.erl b/applications/acdc/src/acdc_agent_listener.erl index 5926450dc38..4782272dbb4 100644 --- a/applications/acdc/src/acdc_agent_listener.erl +++ b/applications/acdc/src/acdc_agent_listener.erl @@ -553,7 +553,7 @@ handle_cast({'member_connect_retry', CallId}, #state{my_id=MyId lager:debug("need to retry member connect, agent isn't able to take it"), send_member_connect_retry(Server, CallId, MyId, AgentId), - _ = [acdc_util:unbind_from_call_events(ACallId) || ACallId <- ACallIds], + lists:foreach(fun acdc_util:unbind_from_call_events/1, ACallIds), acdc_util:unbind_from_call_events(CallId), kz_util:put_callid(AgentId), diff --git a/applications/acdc/src/acdc_agent_maintenance.erl b/applications/acdc/src/acdc_agent_maintenance.erl index aa8fcc3224c..373241386c1 100644 --- a/applications/acdc/src/acdc_agent_maintenance.erl +++ b/applications/acdc/src/acdc_agent_maintenance.erl @@ -26,8 +26,7 @@ acct_status(AcctId) -> [] -> lager:info("no agents with account id ~s available", [AcctId]); As -> lager:info("Agent Statuses in ~s", [AcctId]), - _ = [acdc_agent_sup:status(Sup) || Sup <- As], - 'ok' + lists:foreach(fun acdc_agent_sup:status/1, As) end. agent_status(AcctId, AgentId) when (not is_binary(AcctId)) diff --git a/applications/acdc/src/acdc_agents_sup.erl b/applications/acdc/src/acdc_agents_sup.erl index e07a78b96dd..957d9f0e29e 100644 --- a/applications/acdc/src/acdc_agents_sup.erl +++ b/applications/acdc/src/acdc_agents_sup.erl @@ -47,16 +47,13 @@ start_link() -> status() -> lager:info("ACDc Agents Status"), Ws = workers(), - _ = kz_util:spawn(fun() -> [acdc_agent_sup:status(Sup) || Sup <- Ws] end), + _ = kz_util:spawn(fun() -> lists:foreach(fun acdc_agent_sup:status/1, Ws) end), 'ok'. -spec new(kz_json:object()) -> sup_startchild_ret(). -spec new(ne_binary(), ne_binary()) -> sup_startchild_ret(). new(JObj) -> - case find_agent_supervisor(kz_doc:account_id(JObj) - ,kz_doc:id(JObj) - ) - of + case find_agent_supervisor(kz_doc:account_id(JObj), kz_doc:id(JObj)) of 'undefined' -> supervisor:start_child(?SERVER, [JObj]); P when is_pid(P) -> lager:debug("agent already started here: ~p", [P]) end. diff --git a/applications/acdc/src/acdc_maintenance.erl b/applications/acdc/src/acdc_maintenance.erl index e23c8c5ae83..ef0687b3cc3 100644 --- a/applications/acdc/src/acdc_maintenance.erl +++ b/applications/acdc/src/acdc_maintenance.erl @@ -87,8 +87,7 @@ current_queues(AccountId) -> log_current_queues(Agents) -> io:format(" ~35s | ~s~n", [<<"Agent ID">>, <<"Queue IDs">>]), - _ = [log_current_queue(Agent) || Agent <- Agents], - 'ok'. + lists:foreach(fun log_current_queue/1, Agents). log_current_queue(AgentSup) -> AgentL = acdc_agent_sup:listener(AgentSup), io:format(" ~35s | ~s~n", [acdc_agent_listener:id(AgentL) @@ -104,8 +103,7 @@ current_agents(AccountId) -> end. log_current_agents(Queues) -> io:format(" ~35s | ~s~n", [<<"Queue ID">>, <<"Agent IDs">>]), - _ = [log_current_agent(Queue) || Queue <- Queues], - 'ok'. + lists:foreach(fun log_current_agent/1, Queues). log_current_agent(QueueSup) -> QueueM = acdc_queue_sup:manager(QueueSup), {_AccountId, QueueId} = acdc_queue_manager:config(QueueM), @@ -209,7 +207,7 @@ migrate_to_acdc_db() -> {'ok', Accounts} = kz_datamgr:all_docs(?KZ_ACDC_DB), _ = [maybe_remove_acdc_account(kz_doc:id(Account)) || Account <- Accounts], io:format("removed any missing accounts from ~s~n", [?KZ_ACDC_DB]), - _ = [migrate_to_acdc_db(Acct) || Acct <- kapps_util:get_all_accounts('raw')], + lists:foreach(fun migrate_to_acdc_db/1, kapps_util:get_all_accounts('raw')), io:format("migration complete~n"). -spec maybe_remove_acdc_account(ne_binary()) -> 'ok'. @@ -322,10 +320,8 @@ queues_detail() -> acdc_queues_sup:status(). queues_detail(AcctId) -> kz_util:put_callid(?MODULE), - _ = [acdc_queue_sup:status(S) - || S <- acdc_queues_sup:find_acct_supervisors(AcctId) - ], - 'ok'. + lists:foreach(fun acdc_queue_sup:status/1 + ,acdc_queues_sup:find_acct_supervisors(AcctId)). queue_detail(AcctId, QueueId) -> case acdc_queues_sup:find_queue_supervisor(AcctId, QueueId) of 'undefined' -> lager:info("no queue ~s in account ~s", [QueueId, AcctId]); @@ -410,10 +406,8 @@ agents_detail() -> acdc_agents_sup:status(). agents_detail(AcctId) -> kz_util:put_callid(?MODULE), - _ = [acdc_agent_sup:status(S) - || S <- acdc_agents_sup:find_acct_supervisors(AcctId) - ], - 'ok'. + lists:foreach(fun acdc_agent_sup:status/1 + ,acdc_agents_sup:find_acct_supervisors(AcctId)). agent_detail(AcctId, AgentId) -> kz_util:put_callid(?MODULE), case acdc_agents_sup:find_agent_supervisor(AcctId, AgentId) of diff --git a/applications/acdc/src/acdc_queues_sup.erl b/applications/acdc/src/acdc_queues_sup.erl index e0c0ab39d40..8b04945c07f 100644 --- a/applications/acdc/src/acdc_queues_sup.erl +++ b/applications/acdc/src/acdc_queues_sup.erl @@ -80,7 +80,7 @@ find_queue_supervisor(AcctId, QueueId, [Super|Rest]) -> status() -> lager:info("ACDc Queues Status"), Ws = workers(), - _ = kz_util:spawn(fun() -> [acdc_queue_sup:status(Sup) || Sup <- Ws] end), + _ = kz_util:spawn(fun() -> lists:foreach(fun acdc_queue_sup:status/1, Ws) end), 'ok'. -spec queues_running() -> [{pid(), any()}]. diff --git a/applications/blackhole/src/blackhole.hrl b/applications/blackhole/src/blackhole.hrl index 40fcbc8034d..a5e861f7107 100644 --- a/applications/blackhole/src/blackhole.hrl +++ b/applications/blackhole/src/blackhole.hrl @@ -17,8 +17,7 @@ -type bh_subscribe_result() :: {'ok', bh_context:context()} | {'error', ne_binary()}. --record(bh_context, { - auth_token = <<>> :: api_binary() | '_' +-record(bh_context, {auth_token = <<>> :: api_binary() | '_' ,auth_account_id :: api_binary() | '_' ,account_id :: api_binary() | '_' ,bindings = [] :: ne_binaries() | '_' @@ -31,7 +30,7 @@ ,destination = kz_util:node_hostname() :: ne_binary() | '_' ,source :: api_binary() | '_' ,binding :: api_binary() | '_' - }). + }). -define(BLACKHOLE_HRL, 'true'). diff --git a/applications/blackhole/src/blackhole_bindings.erl b/applications/blackhole/src/blackhole_bindings.erl index 724aa7a09da..51796cdc9ce 100644 --- a/applications/blackhole/src/blackhole_bindings.erl +++ b/applications/blackhole/src/blackhole_bindings.erl @@ -41,6 +41,9 @@ -include("blackhole.hrl"). +-define(BH_MODULES, + kapps_config:get(?BLACKHOLE_CONFIG_CAT, <<"autoload_modules">>, ?DEFAULT_MODULES)). + -type payload() :: bh_context:context() | ne_binary(). %%%=================================================================== @@ -175,10 +178,7 @@ modules_loaded() -> kazoo_bindings:modules_loaded(). init() -> lager:debug("initializing blackhole bindings"), kz_util:put_callid(?LOG_SYSTEM_ID), - _ = [init_mod(Mod) - || Mod <- kapps_config:get(?BLACKHOLE_CONFIG_CAT, <<"autoload_modules">>, ?DEFAULT_MODULES) - ], - 'ok'. + lists:foreach(fun init_mod/1, ?BH_MODULES). init_mod(ModuleName) -> lager:debug("initializing module: ~p", [ModuleName]), diff --git a/applications/cdr/src/cdr_v3_migrate_lib.erl b/applications/cdr/src/cdr_v3_migrate_lib.erl index 8043d620db9..a6f941db18b 100644 --- a/applications/cdr/src/cdr_v3_migrate_lib.erl +++ b/applications/cdr/src/cdr_v3_migrate_lib.erl @@ -142,8 +142,7 @@ delete_test_accounts() -> {'error', _E} -> lager:debug("error retrieving accounts: ~p", [_E]); [] -> 'ok'; Accounts -> - _ = [maybe_delete_test_account(AccountDb) || AccountDb <- Accounts], - 'ok' + lists:foreach(fun maybe_delete_test_account/1, Accounts) end. -spec maybe_get_migrate_account(account_db()) -> 'false' | kz_json:object(). @@ -153,8 +152,9 @@ maybe_get_migrate_account(AccountDb) -> [] -> 'false'; {'ok', Results} -> [kz_json:get_value(<<"doc">>, Result) - || Result <- Results - ,matches_realm(kz_json:get_value(<<"key">>, Result))] + || Result <- Results, + matches_realm(kz_json:get_value(<<"key">>, Result)) + ] end. -spec matches_realm(ne_binary()) -> boolean(). diff --git a/applications/crossbar/src/crossbar_bindings.erl b/applications/crossbar/src/crossbar_bindings.erl index 1955e9b0bcc..be09ca605b7 100644 --- a/applications/crossbar/src/crossbar_bindings.erl +++ b/applications/crossbar/src/crossbar_bindings.erl @@ -196,16 +196,14 @@ start_link() -> -spec init() -> 'ok'. init() -> lager:debug("initializing bindings"), - kz_util:put_callid(?LOG_SYSTEM_ID), - _ = [maybe_init_mod(Mod) - || Mod <- crossbar_config:autoload_modules(?DEFAULT_MODULES) - ], - 'ok'. + lists:foreach(fun maybe_init_mod/1 + ,crossbar_config:autoload_modules(?DEFAULT_MODULES)). -spec maybe_init_mod(ne_binary() | atom()) -> 'ok'. maybe_init_mod(Mod) -> case crossbar_init:start_mod(Mod) of 'ok' -> 'ok'; - {'error', Error} -> lager:notice("failed to initialize ~s: ~p", [Mod, Error]) + {'error', Error} -> + lager:notice("failed to initialize ~s: ~p", [Mod, Error]) end. diff --git a/applications/crossbar/src/crossbar_freeswitch.erl b/applications/crossbar/src/crossbar_freeswitch.erl index 963829571ae..9a6d993e4f8 100644 --- a/applications/crossbar/src/crossbar_freeswitch.erl +++ b/applications/crossbar/src/crossbar_freeswitch.erl @@ -271,8 +271,7 @@ process_realm(Realm, Dir, Module) -> lager:debug("wrote file ~s", [XMLFile]); {'error', E} -> lager:debug("error rendering template ~s for realm ~s: ~p" - ,[Module, Realm, E] - ) + ,[Module, Realm, E]) end. %% @private @@ -302,8 +301,7 @@ crawl_numbers_db(NumberDb) -> maybe_export_numbers(Db, Numbers); {'error', _R} -> lager:debug("error getting number docs from ~s: ~p" - ,[NumberDb, _R] - ) + ,[NumberDb, _R]) catch _E:_R -> lager:debug("~s getting number docs from ~s: ~p" @@ -313,11 +311,11 @@ crawl_numbers_db(NumberDb) -> -spec get_numbers(kz_json:objects()) -> ne_binaries(). get_numbers(JObjs) -> [Number - || JObj <- JObjs - ,case (Number = kz_doc:id(JObj)) of - <<"_design/", _/binary>> -> 'false'; - _Else -> 'true' - end + || JObj <- JObjs, + case (Number = kz_doc:id(JObj)) of + <<"_design/", _/binary>> -> 'false'; + _Else -> 'true' + end ]. -spec maybe_export_numbers(ne_binary(), ne_binaries()) -> 'ok'. @@ -331,8 +329,7 @@ maybe_export_numbers(Db, [Number|Numbers]) -> ); {'error', _R} -> lager:debug("error fetching number ~s from ~d: ~p" - ,[Number, Db, _R] - ) + ,[Number, Db, _R]) end, maybe_export_numbers(Db, Numbers). diff --git a/applications/crossbar/src/modules/cb_modules_util.erl b/applications/crossbar/src/modules/cb_modules_util.erl index ee9aebe7849..2e159cceef7 100644 --- a/applications/crossbar/src/modules/cb_modules_util.erl +++ b/applications/crossbar/src/modules/cb_modules_util.erl @@ -572,11 +572,11 @@ take_sync_field(Context) -> %% @public -spec remove_plaintext_password(cb_context:context()) -> cb_context:context(). remove_plaintext_password(Context) -> - Doc = kz_json:delete_keys( - [<<"password">>, - <<"confirm_password">> - ], cb_context:doc(Context) - ), + Doc = kz_json:delete_keys([<<"password">> + ,<<"confirm_password">> + ] + ,cb_context:doc(Context) + ), cb_context:set_doc(Context, Doc). -type assignment_updates() :: [{ne_binary(), knm_number:knm_number_return()}]. @@ -590,8 +590,7 @@ apply_assignment_updates(Updates) -> -spec log_assignment_updates(assignment_updates()) -> 'ok'. log_assignment_updates(Updates) -> - _ = [log_assignment_update(Update) || Update <- Updates], - 'ok'. + lists:foreach(fun log_assignment_update/1, Updates). -spec log_assignment_update({ne_binary(), knm_number:knm_number_return()}) -> 'ok'. log_assignment_update({DID, {'ok', _Number}}) -> diff --git a/applications/doodle/src/doodle_inbound_listener_sup.erl b/applications/doodle/src/doodle_inbound_listener_sup.erl index d8bbf322511..859176c604c 100644 --- a/applications/doodle/src/doodle_inbound_listener_sup.erl +++ b/applications/doodle/src/doodle_inbound_listener_sup.erl @@ -42,8 +42,7 @@ start_inbound_listener(Connection) -> -spec start_listeners() -> 'ok'. start_listeners() -> - _ = [start_inbound_listener(C) || C <- connections()], - 'ok'. + lists:foreach(fun start_inbound_listener/1, connections()). %%-------------------------------------------------------------------- %% @public diff --git a/applications/ecallmgr/src/ecallmgr_fs_channels.erl b/applications/ecallmgr/src/ecallmgr_fs_channels.erl index 33a04cb7b86..daa2ade757a 100644 --- a/applications/ecallmgr/src/ecallmgr_fs_channels.erl +++ b/applications/ecallmgr/src/ecallmgr_fs_channels.erl @@ -892,12 +892,10 @@ cleanup_old_channels(MaxAge) -> -spec hangup_old_channels(old_channels()) -> 'ok'. hangup_old_channels(OldChannels) -> - _ = [hangup_old_channel(C) || C <- OldChannels], - 'ok'. + lists:foreach(fun hangup_old_channel/1, OldChannels). -spec hangup_old_channel(old_channel()) -> 'ok'. hangup_old_channel([UUID, Node, Started]) -> lager:debug("killing channel ~s on ~s, started ~s" - ,[UUID, Node, kz_util:pretty_print_datetime(Started)] - ), + ,[UUID, Node, kz_util:pretty_print_datetime(Started)]), freeswitch:api(Node, 'uuid_kill', UUID). diff --git a/applications/ecallmgr/src/ecallmgr_fs_node.erl b/applications/ecallmgr/src/ecallmgr_fs_node.erl index 12cc7936fd4..dfbf00aa72b 100644 --- a/applications/ecallmgr/src/ecallmgr_fs_node.erl +++ b/applications/ecallmgr/src/ecallmgr_fs_node.erl @@ -599,7 +599,7 @@ was_not_successful_cmd(_) -> 'true'. -spec print_api_responses(cmd_results()) -> 'ok'. print_api_responses(Res) -> lager:debug("start cmd results:"), - _ = [ print_api_response(ApiRes) || ApiRes <- lists:flatten(Res)], + lists:foreach(fun print_api_response/1, lists:flatten(Res)), lager:debug("end cmd results"). -spec print_api_response(cmd_result()) -> 'ok'. @@ -620,7 +620,7 @@ channels_as_json(Node) -> Keys = binary:split(Header, <<"|||">>, ['global']), [kz_json:from_list(lists:zip(Keys, Values)) || Line <- Rest, - ((Values = binary:split(Line, <<"|||">>, ['global'])) =/= [Line]) + (Values = binary:split(Line, <<"|||">>, ['global'])) =/= [Line] ] end; {'error', _} -> [] diff --git a/applications/ecallmgr/src/ecallmgr_maintenance.erl b/applications/ecallmgr/src/ecallmgr_maintenance.erl index bb373fdbc68..28bb3ca71f8 100644 --- a/applications/ecallmgr/src/ecallmgr_maintenance.erl +++ b/applications/ecallmgr/src/ecallmgr_maintenance.erl @@ -422,17 +422,15 @@ channel_details(UUID) -> -spec sync_channels() -> 'ok'. sync_channels() -> - _ = [ecallmgr_fs_node:sync_channels(Srv) - || Srv <- gproc:lookup_pids({'p', 'l', 'fs_node'}) - ], - 'ok'. + lists:foreach(fun ecallmgr_fs_node:sync_channels/1 + ,gproc:lookup_pids({'p', 'l', 'fs_node'})). -spec sync_channels(text()) -> 'ok'. sync_channels(Node) -> N = kz_util:to_atom(Node, 'true'), _ = [ecallmgr_fs_node:sync_channels(Srv) - || Srv <- gproc:lookup_pids({'p', 'l', 'fs_node'}) - ,ecallmgr_fs_node:fs_node(Srv) =:= N + || Srv <- gproc:lookup_pids({'p', 'l', 'fs_node'}), + ecallmgr_fs_node:fs_node(Srv) =:= N ], 'ok'. @@ -458,10 +456,8 @@ conference_details(UUID) -> -spec sync_conferences() -> 'ok'. sync_conferences() -> - _ = [ecallmgr_fs_conferences:sync_node(N) - || N <- ecallmgr_fs_nodes:connected() - ], - 'ok'. + lists:foreach(fun ecallmgr_fs_conferences:sync_node/1 + ,ecallmgr_fs_nodes:connected()). -spec sync_conferences(text()) -> 'ok'. sync_conferences(Node) -> diff --git a/applications/hotornot/src/hotornot_maintenance.erl b/applications/hotornot/src/hotornot_maintenance.erl index 79f16cd3a75..fdf6aad97de 100644 --- a/applications/hotornot/src/hotornot_maintenance.erl +++ b/applications/hotornot/src/hotornot_maintenance.erl @@ -15,10 +15,12 @@ -include("hotornot.hrl"). --define(LOCAL_SUMMARY_ROW_FORMAT, " ~45.s | ~9.s | ~9.s | ~9.s | ~9.s | ~9.s | ~15.s |~n"). --define(LOCAL_SUMMARY_HEADER, io:format(?LOCAL_SUMMARY_ROW_FORMAT, [<<"RATE NAME">>, <<"COST">>, <<"INCREMENT">>, <<"MINIMUM">> - ,<<"SURCHARGE">>, <<"WEIGHT">>, <<"PREFIX">> - ])). +-define(LOCAL_SUMMARY_ROW_FORMAT, + " ~45.s | ~9.s | ~9.s | ~9.s | ~9.s | ~9.s | ~15.s |~n"). +-define(LOCAL_SUMMARY_HEADER, + io:format(?LOCAL_SUMMARY_ROW_FORMAT, [<<"RATE NAME">>, <<"COST">>, <<"INCREMENT">>, <<"MINIMUM">> + ,<<"SURCHARGE">>, <<"WEIGHT">>, <<"PREFIX">> + ])). -spec local_summary() -> 'ok'. local_summary() -> @@ -35,7 +37,7 @@ rates_for_did(DID, Direction, RouteOptions) when is_list(RouteOptions) -> {'ok', Rates} -> io:format("Candidates:~n", []), ?LOCAL_SUMMARY_HEADER, - _ = [print_rate(R) || R <- Rates], + lists:foreach(fun print_rate/1, Rates), print_matching(hon_util:matching_rates(Rates, DID, Direction, RouteOptions)) end; @@ -52,11 +54,10 @@ print_matching(Matching) -> [Winning|Sorted] = hon_util:sort_rates(Matching), Name = kz_json:get_value(<<"rate_name">>, Winning), - _ = [print_rate(R) - || R <- [kz_json:set_value(<<"rate_name">>, <<"* ", Name/binary>>, Winning) - | Sorted] - ], - 'ok'. + lists:foreach(fun print_rate/1 + ,[kz_json:set_value(<<"rate_name">>, <<"* ", Name/binary>>, Winning) + | Sorted + ]). -spec rates_between(ne_binary(), ne_binary()) -> 'ok'. rates_between(Pre, Post) -> diff --git a/applications/tasks/src/knm_number_crawler.erl b/applications/tasks/src/knm_number_crawler.erl index 4bb2d11384c..c2ffb7179e7 100644 --- a/applications/tasks/src/knm_number_crawler.erl +++ b/applications/tasks/src/knm_number_crawler.erl @@ -65,7 +65,7 @@ stop() -> crawl_numbers() -> kz_util:put_callid(?MODULE), lager:debug("beginning a number crawl"), - _ = [crawl_number_db(Db) || Db <- knm_util:get_all_number_dbs()], + lists:foreach(fun crawl_number_db/1, knm_util:get_all_number_dbs()), lager:debug("finished the number crawl"). %%%=================================================================== diff --git a/applications/webhooks/src/webhooks_init.erl b/applications/webhooks/src/webhooks_init.erl index 99baf1e0866..dfbe2204749 100644 --- a/applications/webhooks/src/webhooks_init.erl +++ b/applications/webhooks/src/webhooks_init.erl @@ -62,9 +62,7 @@ init_master_account_db(MasterAccountDb) -> -spec init_modules() -> 'ok'. init_modules() -> - _ = [init_module(Mod) - || Mod <- existing_modules() - ], + lists:foreach(fun init_module/1, existing_modules()), lager:debug("finished initializing modules"). -spec init_module(atom()) -> 'ok'. diff --git a/applications/webhooks/src/webhooks_util.erl b/applications/webhooks/src/webhooks_util.erl index 0f0a733e906..3d968b4500a 100644 --- a/applications/webhooks/src/webhooks_util.erl +++ b/applications/webhooks/src/webhooks_util.erl @@ -507,8 +507,7 @@ enable_descendant_hooks(Account) -> -spec maybe_enable_descendants_hooks(ne_binaries()) -> 'ok'. maybe_enable_descendants_hooks(Accounts) -> - _ = [maybe_enable_descendant_hooks(Account) || Account <- Accounts], - 'ok'. + lists:foreach(fun maybe_enable_descendant_hooks/1, Accounts). -spec maybe_enable_descendant_hooks(ne_binary()) -> 'ok'. maybe_enable_descendant_hooks(Account) -> diff --git a/core/kazoo/src/gen_listener.erl b/core/kazoo/src/gen_listener.erl index c876c4b4a6e..3eb41390635 100644 --- a/core/kazoo/src/gen_listener.erl +++ b/core/kazoo/src/gen_listener.erl @@ -526,7 +526,7 @@ handle_cast({'start_listener', _Params}, State) -> {'noreply', State}; handle_cast({'pause_consumers'}, #state{is_consuming='true', consumer_tags=Tags}=State) -> - _ = [amqp_util:basic_cancel(Tag) || Tag <- Tags], + lists:foreach(fun amqp_util:basic_cancel/1, Tags), {'noreply', State}; handle_cast({'resume_consumers'}, #state{queue='undefined'}=State) -> diff --git a/core/kazoo_globals/src/kz_nodes.erl b/core/kazoo_globals/src/kz_nodes.erl index dd758f2ddb0..1bf64edc918 100644 --- a/core/kazoo_globals/src/kz_nodes.erl +++ b/core/kazoo_globals/src/kz_nodes.erl @@ -276,8 +276,7 @@ maybe_print_media_servers(#kz_node{media_servers=MediaServers io:format("Channels : ~B~n", [Channels]), io:format("Registrations : ~B~n", [Registrations]), print_media_server(Server, ?MEDIA_SERVERS_HEADER), - _ =[print_media_server(OtherServer) || OtherServer <- Servers], - 'ok' + lists:foreach(fun print_media_server/1, Servers) end. -spec print_media_server(media_server()) -> 'ok'. diff --git a/core/kazoo_modb/src/kazoo_modb_maintenance.erl b/core/kazoo_modb/src/kazoo_modb_maintenance.erl index cd966180e97..3fe2650b6f6 100644 --- a/core/kazoo_modb/src/kazoo_modb_maintenance.erl +++ b/core/kazoo_modb/src/kazoo_modb_maintenance.erl @@ -80,7 +80,7 @@ archive_modbs(AccountId) -> -spec do_archive_modbs(ne_binaries(), api_binary()) -> 'no_return'. do_archive_modbs(MODbs, AccountId) -> kz_util:put_callid(?MODULE), - _ = [kazoo_modb:maybe_archive_modb(MODb) || MODb <- MODbs], + lists:foreach(fun kazoo_modb:maybe_archive_modb/1, MODbs), Keep = kapps_config:get_integer(?CONFIG_CAT, <<"active_modbs">>, 6), From = case AccountId =:= 'undefined' of 'true' -> <<"all">>; 'false' -> AccountId end, io:format("archived ~s MODbs more than ~b months old~n", [From, Keep]), @@ -100,8 +100,7 @@ verify_rollups() -> {pos_integer(), pos_integer()}. verify_db_rollup(AccountDb, {Current, Total}) -> io:format("verify rollup accounts (~p/~p) '~s'~n" - ,[Current, Total, AccountDb] - ), + ,[Current, Total, AccountDb]), verify_rollups(AccountDb), {Current+1, Total}. diff --git a/core/kazoo_number_manager/src/carriers/knm_bandwidth2.erl b/core/kazoo_number_manager/src/carriers/knm_bandwidth2.erl index bfa89e76322..9d7de00be63 100644 --- a/core/kazoo_number_manager/src/carriers/knm_bandwidth2.erl +++ b/core/kazoo_number_manager/src/carriers/knm_bandwidth2.erl @@ -216,7 +216,7 @@ sites() -> {'ok', Xml} = api_get(url(["sites"])), io:format("listing all sites for account ~p~n", [?BW2_ACCOUNT_ID]), Sites = xmerl_xpath:string("Sites/Site", Xml), - _ = [process_site(X) || X <- Sites], + lists:foreach(fun process_site/1, Sites), io:format("done.~n"). -spec process_site(xml_el()) -> 'ok'. @@ -231,7 +231,7 @@ peers(SiteId) -> {'ok', Xml} = api_get(url(["sippeers"])), io:format("listing all peers for account ~p, site ~p~n", [?BW2_ACCOUNT_ID, SiteId]), Peers = xmerl_xpath:string("SipPeers/SipPeer", Xml), - _ = [process_peer(X) || X <- Peers], + lists:foreach(fun process_peer/1, Peers), io:format("done.~n"). -spec process_peer(xml_el()) -> 'ok'. @@ -245,8 +245,8 @@ process_peer(Peer) -> -spec url([nonempty_string()]) -> nonempty_string(). url(RelativePath) -> lists:flatten( - [ io_lib:format("~s/accounts/~s/", [?BW2_BASE_URL, ?BW2_ACCOUNT_ID]) - | RelativePath + [io_lib:format("~s/accounts/~s/", [?BW2_BASE_URL, ?BW2_ACCOUNT_ID]) + | RelativePath ]). -type api_res() :: {'ok', xml_el()} | {'error', atom()}. diff --git a/core/kazoo_voicemail/src/kvm_maintenance.erl b/core/kazoo_voicemail/src/kvm_maintenance.erl index 41e8e4c0fe1..708d88d3ef9 100644 --- a/core/kazoo_voicemail/src/kvm_maintenance.erl +++ b/core/kazoo_voicemail/src/kvm_maintenance.erl @@ -26,8 +26,7 @@ %%-------------------------------------------------------------------- -spec migrate() -> 'ok'. migrate() -> - _ = [migrate(Id)|| Id <- kapps_util:get_all_accounts('raw')], - 'ok'. + lists:foreach(fun migrate/1, kapps_util:get_all_accounts('raw')). -spec migrate(ne_binary()) -> 'ok'. migrate(AccountId) -> diff --git a/core/webseq/src/webseq.erl b/core/webseq/src/webseq.erl index e2ef9410e99..438a8846fb2 100644 --- a/core/webseq/src/webseq.erl +++ b/core/webseq/src/webseq.erl @@ -61,9 +61,7 @@ stop() -> case gproc:select('n', [{MatchHead, Guard, [Result]}]) of [] -> 'ok'; - Pids -> - _ = [stop_pid(Pid) || Pid <- Pids], - 'ok' + Pids -> lists:foreach(fun stop_pid/1, Pids) end. stop(Type) ->