diff options
author | Magnus Feuer <mfeuer@jaguarlandrover.com> | 2015-06-25 13:37:33 -0700 |
---|---|---|
committer | Magnus Feuer <mfeuer@jaguarlandrover.com> | 2015-06-25 13:37:33 -0700 |
commit | b116a72d2bdb88247907e415b3fcdcf83308e255 (patch) | |
tree | bd68264de08452c626262b7d1b2e10680e7aa16c /components/rvi_common | |
parent | 6d08b7662a0508a1a56581ee8338cb1797493282 (diff) | |
parent | a0212bad260f828fcc4298c0513a28c183514995 (diff) | |
download | rvi_core-b116a72d2bdb88247907e415b3fcdcf83308e255.tar.gz |
MErged in Ulf's changes
Diffstat (limited to 'components/rvi_common')
-rw-r--r-- | components/rvi_common/include/rvi_dlink.hrl | 1 | ||||
-rw-r--r-- | components/rvi_common/src/rvi_common.erl | 13 | ||||
-rw-r--r-- | components/rvi_common/src/rvi_config.erl | 3 |
3 files changed, 14 insertions, 3 deletions
diff --git a/components/rvi_common/include/rvi_dlink.hrl b/components/rvi_common/include/rvi_dlink.hrl index d579923..bd500ad 100644 --- a/components/rvi_common/include/rvi_dlink.hrl +++ b/components/rvi_common/include/rvi_dlink.hrl @@ -19,6 +19,7 @@ -define(DLINK_ARG_PORT, "port"). -define(DLINK_ARG_VERSION, "ver"). -define(DLINK_ARG_CERTIFICATE, "cert"). +-define(DLINK_ARG_CERTIFICATES, "certs"). -define(DLINK_ARG_SIGNATURE, "sign"). -define(DLINK_ARG_SERVICES, "svcs"). -define(DLINK_ARG_MODULE, "mod"). diff --git a/components/rvi_common/src/rvi_common.erl b/components/rvi_common/src/rvi_common.erl index 19055af..70a8a85 100644 --- a/components/rvi_common/src/rvi_common.erl +++ b/components/rvi_common/src/rvi_common.erl @@ -39,6 +39,7 @@ get_module_json_rpc_url/3, get_module_genserver_pid/3 ]). +-export([utc_timestamp/0]). -export([start_json_rpc_server/3]). -export([extract_json/2]). @@ -659,8 +660,6 @@ start_json_rpc_server(Component, Module, Supervisor) -> [ Component, Module ]), Err end. - - @@ -785,3 +784,13 @@ extract_json(Buf, undefined) -> extract_json(Buf, PST) -> extract_json(Buf, PST,[]). + + +utc_timestamp() -> + calendar:datetime_to_gregorian_seconds( + calendar:universal_time()) - seconds_jan_1970(). + +seconds_jan_1970() -> + %% calendar:datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}}). + 62167219200. + diff --git a/components/rvi_common/src/rvi_config.erl b/components/rvi_common/src/rvi_config.erl index 15e2430..a476bf5 100644 --- a/components/rvi_common/src/rvi_config.erl +++ b/components/rvi_common/src/rvi_config.erl @@ -212,7 +212,8 @@ substitute(Other, Acc) -> [ Other | Acc ]. setup_substitution(App) -> - Env = application:get_all_env(App), + Env = [{K, setup:expand_value(App, V)} || + {K, V} <-application:get_all_env(App)], Subst = substitute(Env,[]), case is_list(Subst) of false -> ok; |