aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-04-27 11:27:21 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-04-27 11:27:21 +0200
commitc0739409997961f358656fc4cd5bf7abfef5f858 (patch)
treec8adb48ecbfd7e7a19397760a782d9cdbd43a2c4 /lib
parent6f0a08d85feac7103b573e20d6250ea880c6400f (diff)
downloadotp-c0739409997961f358656fc4cd5bf7abfef5f858.tar.gz
otp-c0739409997961f358656fc4cd5bf7abfef5f858.tar.bz2
otp-c0739409997961f358656fc4cd5bf7abfef5f858.zip
test_server: Fix install_hook
We cannot use erlang:unique_integer([positive]) here since this code in run on older test releases as well.
Diffstat (limited to 'lib')
-rw-r--r--lib/test_server/src/ts_install_cth.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/test_server/src/ts_install_cth.erl b/lib/test_server/src/ts_install_cth.erl
index 3dfa6174fe..54ca69637e 100644
--- a/lib/test_server/src/ts_install_cth.erl
+++ b/lib/test_server/src/ts_install_cth.erl
@@ -238,9 +238,15 @@ generate_nodenames2(0, _Hosts, Acc) ->
Acc;
generate_nodenames2(N, Hosts, Acc) ->
Host=lists:nth((N rem (length(Hosts)))+1, Hosts),
- Name=list_to_atom(temp_nodename("nod") ++ "@" ++ Host),
+ Name=list_to_atom(temp_nodename("nod",N) ++ "@" ++ Host),
generate_nodenames2(N-1, Hosts, [Name|Acc]).
-temp_nodename(Base) ->
- Num = erlang:unique_integer([positive]),
- Base ++ integer_to_list(Num).
+%% We cannot use erlang:unique_integer([positive])
+%% here since this code in run on older test releases as well.
+temp_nodename(Base,I) ->
+ {A,B,C} = os:timestamp(),
+ Nstr = integer_to_list(I),
+ Astr = integer_to_list(A),
+ Bstr = integer_to_list(B),
+ Cstr = integer_to_list(C),
+ Base++Nstr++Astr++Bstr++Cstr.