auser-poolparty 0.2.55 → 0.2.56

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,10 +10,7 @@ end
10
10
  o.loaded_clouds.each do |cloud|
11
11
 
12
12
  with_cloud(cloud) do
13
- cmd = <<-EOE
14
- puppetrun --host #{list_of_node_names.join(", --host ")}
15
- EOE
16
- run_command_on(cmd.runnable, master)
13
+ reconfigure_cloud!("force_reconfig")
17
14
  end
18
15
 
19
16
  end
@@ -1,6 +1,6 @@
1
1
  % Includes file for the PoolParty Messenger
2
2
 
3
- % -define(debug, true).
3
+ -define(debug, true).
4
4
 
5
5
  -ifdef(debug).
6
6
 
@@ -1,4 +1,4 @@
1
- %% script generated at {2008,11,11} {20,31,50}
1
+ %% script generated at {2008,11,12} {12,32,15}
2
2
  {script,
3
3
  {"client","0.1"},
4
4
  [{preLoaded,
@@ -1,4 +1,4 @@
1
- %% script generated at {2008,11,11} {20,31,50}
1
+ %% script generated at {2008,11,12} {12,32,15}
2
2
  {script,
3
3
  {"master","0.1"},
4
4
  [{preLoaded,
@@ -1,4 +1,4 @@
1
- %% script generated at {2008,11,11} {20,31,50}
1
+ %% script generated at {2008,11,12} {12,32,15}
2
2
  {script,
3
3
  {"node","0.1"},
4
4
  [{preLoaded,
@@ -4,6 +4,7 @@
4
4
  -export ([start/0]).
5
5
 
6
6
  -define (RECONNECT_TIMEOUT, 10000).
7
+ -define (CAST_MESSAGES, [force_reconfig]).
7
8
 
8
9
  start() ->
9
10
  utils:start_timer(client_timer, ?UPDATE_TIME, fun() -> client_server:connect_to_master() end),
@@ -14,14 +15,16 @@ master_server() -> global:whereis_name(pm_master).
14
15
  loop(Socket) ->
15
16
  case gen_tcp:recv(Socket, 0) of
16
17
  {ok, Data} ->
17
- ?TRACE("received", [master_server(), erlang:binary_to_list(Data)]),
18
18
  % Args = [Item || K <- string:tokens(erlang:binary_to_list(Data), " "), Item <- erlang:list_to_atom(K)],
19
19
  [Meth|Args] = string:tokens(erlang:binary_to_list(Data), " "),
20
- ?TRACE("received", [Meth, Args]),
21
- Output = gen_server:call(master_server(), {erlang:list_to_atom(Meth), Args}),
22
- ?TRACE("received from gen_server", [Output]),
23
- send_back_appropriate_response(Socket, Output),
24
- ?TRACE("posted", [Output]),
20
+ case lists:member(erlang:list_to_atom(Meth), ?CAST_MESSAGES) of
21
+ true ->
22
+ ?TRACE("Received cast message", [Meth]);
23
+ _ ->
24
+ Output = gen_server:call(master_server(), {erlang:list_to_atom(Meth), Args}),
25
+ send_back_appropriate_response(Socket, Output),
26
+ ?TRACE("posted", [Output])
27
+ end,
25
28
  loop(Socket);
26
29
  {error, closed} ->
27
30
  ok
@@ -30,6 +30,12 @@ module PoolParty
30
30
  @str
31
31
  end
32
32
 
33
+ def messenger_cast!(msg="force_reconfig")
34
+ with_socket do |sock|
35
+ sock.send(msg, 0)
36
+ end
37
+ end
38
+
33
39
  def self.messenger_send!(cmd="", testing=false)
34
40
  command = Messenger.erl_command("client#{Time.now.to_i}", "-s pm_client -run pm_client #{cmd} -s erlang halt -noshell")
35
41
  testing ? command : %x[#{command}]
@@ -54,8 +60,8 @@ module PoolParty
54
60
  nodes.split(" ").map {|a| a.split(/@/)[-1] }
55
61
  end
56
62
 
57
- def reconfigure_cloud!
58
- messenger_send!("reconfigure_cloud")
63
+ def reconfigure_cloud!(msg="force_reconfig")
64
+ messenger_cast!(msg)
59
65
  end
60
66
  end
61
67
  end
@@ -2,7 +2,7 @@ module PoolParty
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 55
5
+ TINY = 56
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poolparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.55
4
+ version: 0.2.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Lerner
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auser-poolparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.55
4
+ version: 0.2.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Lerner