right_agent 0.5.10 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/right_agent/agent.rb
CHANGED
@@ -69,6 +69,7 @@ module RightScale
|
|
69
69
|
:retry_timeout => nil,
|
70
70
|
:connect_timeout => 60,
|
71
71
|
:reconnect_interval => 60,
|
72
|
+
:offline_queueing => false,
|
72
73
|
:ping_interval => 0,
|
73
74
|
:check_interval => 5 * 60,
|
74
75
|
:grace_timeout => 30,
|
@@ -100,6 +101,9 @@ module RightScale
|
|
100
101
|
# by the receiver, 0 means never expire, defaults to 0
|
101
102
|
# :connect_timeout(Integer):: Number of seconds to wait for a broker connection to be established
|
102
103
|
# :reconnect_interval(Integer):: Number of seconds between broker reconnect attempts
|
104
|
+
# :offline_queueing(Boolean):: Whether to queue request if currently not connected to any brokers,
|
105
|
+
# also requires agent invocation of Sender initialize_offline_queue and start_offline_queue methods,
|
106
|
+
# as well as enable_offline_mode and disable_offline_mode as broker connections status changes
|
103
107
|
# :ping_interval(Integer):: Minimum number of seconds since last message receipt to ping the mapper
|
104
108
|
# to check connectivity, defaults to 0 meaning do not ping
|
105
109
|
# :check_interval(Integer):: Number of seconds between publishing stats and checking for broker connections
|
@@ -177,7 +177,8 @@ module RightScale
|
|
177
177
|
# All security files matching pattern
|
178
178
|
#
|
179
179
|
# === Parameters
|
180
|
-
# pattern(String):: Pattern for security files of interest, e.g., '*.cert'
|
180
|
+
# pattern(String):: Pattern for security files of interest, e.g., '*.cert' or
|
181
|
+
# '*.{cert,key}'
|
181
182
|
#
|
182
183
|
# === Return
|
183
184
|
# files(Array):: Path name of files found
|
@@ -28,7 +28,8 @@ module RightScale
|
|
28
28
|
|
29
29
|
include Serializable
|
30
30
|
|
31
|
-
attr_accessor :uuid, :username, :public_key, :public_keys, :common_name,
|
31
|
+
attr_accessor :uuid, :username, :public_key, :public_keys, :common_name,
|
32
|
+
:superuser, :expires_at, :home_archive_url
|
32
33
|
|
33
34
|
# Initialize fields from given arguments
|
34
35
|
def initialize(*args)
|
@@ -39,6 +40,7 @@ module RightScale
|
|
39
40
|
@superuser = args[4] || false
|
40
41
|
@expires_at = Time.at(args[5]) if args[5] && (args[5] != 0) # nil -> 0 because of expires_at.to_i below
|
41
42
|
@public_keys = args[6]
|
43
|
+
@home_archive_url = args[7]
|
42
44
|
|
43
45
|
# we now expect an array of public_keys to be passed while supporting the
|
44
46
|
# singular public_key as a legacy member. when serialized back from a
|
@@ -55,7 +57,7 @@ module RightScale
|
|
55
57
|
|
56
58
|
# Array of serialized fields given to constructor
|
57
59
|
def serialized_members
|
58
|
-
[ @uuid, @username, @public_key, @common_name, @superuser, @expires_at.to_i, @public_keys ]
|
60
|
+
[ @uuid, @username, @public_key, @common_name, @superuser, @expires_at.to_i, @public_keys, @home_archive_url ]
|
59
61
|
end
|
60
62
|
|
61
63
|
end
|
@@ -28,6 +28,9 @@ begin
|
|
28
28
|
begin
|
29
29
|
EM.run{
|
30
30
|
@conn ||= connect *args
|
31
|
+
@conn.callback { AMQP.channel = AMQP::Channel.new(@conn) }
|
32
|
+
|
33
|
+
# callback passed to .start must come last
|
31
34
|
@conn.callback(&blk) if blk
|
32
35
|
@conn
|
33
36
|
}
|
@@ -50,6 +53,7 @@ begin
|
|
50
53
|
|
51
54
|
timeout @settings[:timeout] if @settings[:timeout]
|
52
55
|
errback{ @on_disconnect.call } unless @reconnecting
|
56
|
+
@connection_status = @settings[:connection_status]
|
53
57
|
|
54
58
|
# TCP connection "openness"
|
55
59
|
@tcp_connection_established = false
|
@@ -158,11 +162,19 @@ begin
|
|
158
162
|
# Exchange)
|
159
163
|
AMQP::Queue.class_eval do
|
160
164
|
def initialize(mq, name, opts = {}, &block)
|
165
|
+
raise ArgumentError, "queue name must not be nil. Use '' (empty string) for server-named queues." if name.nil?
|
166
|
+
|
161
167
|
@mq = mq
|
162
168
|
@opts = self.class.add_default_options(name, opts, block)
|
163
169
|
@bindings ||= {}
|
164
|
-
@name = name unless name.empty?
|
165
170
|
@status = @opts[:nowait] ? :unknown : :unfinished
|
171
|
+
|
172
|
+
if name.empty?
|
173
|
+
@mq.queues_awaiting_declare_ok.push(self)
|
174
|
+
else
|
175
|
+
@name = name
|
176
|
+
end
|
177
|
+
|
166
178
|
unless opts[:no_declare]
|
167
179
|
@mq.callback{
|
168
180
|
@mq.send AMQP::Protocol::Queue::Declare.new(@opts)
|
data/lib/right_agent/sender.rb
CHANGED
@@ -545,7 +545,8 @@ module RightScale
|
|
545
545
|
# message(Packet):: Message being processed
|
546
546
|
# agent(Agent):: Reference to agent
|
547
547
|
# :offline_queueing(Boolean):: Whether to queue request if currently not connected to any brokers,
|
548
|
-
# also requires agent invocation of initialize_offline_queue and start_offline_queue methods below
|
548
|
+
# also requires agent invocation of initialize_offline_queue and start_offline_queue methods below,
|
549
|
+
# as well as enable_offline_mode and disable_offline_mode as broker connections status changes
|
549
550
|
# :ping_interval(Integer):: Minimum number of seconds since last message receipt to ping the mapper
|
550
551
|
# to check connectivity, defaults to 0 meaning do not ping
|
551
552
|
# :restart_callback(Proc):: Callback that is activated on each restart vote with votes being initiated
|
data/right_agent.gemspec
CHANGED
@@ -24,7 +24,7 @@ require 'rubygems'
|
|
24
24
|
|
25
25
|
Gem::Specification.new do |spec|
|
26
26
|
spec.name = 'right_agent'
|
27
|
-
spec.version = '0.
|
27
|
+
spec.version = '0.6.0'
|
28
28
|
spec.authors = ['Lee Kirchhoff', 'Raphael Simon', 'Tony Spataro']
|
29
29
|
spec.email = 'lee@rightscale.com'
|
30
30
|
spec.homepage = 'https://github.com/rightscale/right_agent'
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.require_path = 'lib'
|
38
38
|
|
39
39
|
spec.add_dependency('right_support', '~> 1.0')
|
40
|
-
spec.add_dependency('amqp', '0.7.
|
40
|
+
spec.add_dependency('amqp', '0.7.5')
|
41
41
|
spec.add_dependency('json', ['~> 1.4'])
|
42
42
|
spec.add_dependency('eventmachine', '~> 0.12.10')
|
43
43
|
spec.add_dependency('right_popen', '~> 1.0.11')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lee Kirchhoff
|
@@ -17,11 +17,14 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-11-
|
20
|
+
date: 2011-11-11 00:00:00 -08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
-
|
24
|
+
prerelease: false
|
25
|
+
type: :runtime
|
26
|
+
name: right_support
|
27
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
29
|
requirements:
|
27
30
|
- - ~>
|
@@ -31,28 +34,28 @@ dependencies:
|
|
31
34
|
- 1
|
32
35
|
- 0
|
33
36
|
version: "1.0"
|
34
|
-
|
37
|
+
requirement: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
35
39
|
prerelease: false
|
36
40
|
type: :runtime
|
37
|
-
|
38
|
-
|
39
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
name: amqp
|
42
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
43
|
none: false
|
41
44
|
requirements:
|
42
45
|
- - "="
|
43
46
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
47
|
+
hash: 9
|
45
48
|
segments:
|
46
49
|
- 0
|
47
50
|
- 7
|
48
|
-
-
|
49
|
-
version: 0.7.
|
50
|
-
|
51
|
+
- 5
|
52
|
+
version: 0.7.5
|
53
|
+
requirement: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
51
55
|
prerelease: false
|
52
56
|
type: :runtime
|
53
|
-
|
54
|
-
|
55
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
name: json
|
58
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
59
|
none: false
|
57
60
|
requirements:
|
58
61
|
- - ~>
|
@@ -62,12 +65,12 @@ dependencies:
|
|
62
65
|
- 1
|
63
66
|
- 4
|
64
67
|
version: "1.4"
|
65
|
-
|
68
|
+
requirement: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
66
70
|
prerelease: false
|
67
71
|
type: :runtime
|
68
|
-
|
69
|
-
|
70
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
name: eventmachine
|
73
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
74
|
none: false
|
72
75
|
requirements:
|
73
76
|
- - ~>
|
@@ -78,12 +81,12 @@ dependencies:
|
|
78
81
|
- 12
|
79
82
|
- 10
|
80
83
|
version: 0.12.10
|
81
|
-
|
84
|
+
requirement: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
82
86
|
prerelease: false
|
83
87
|
type: :runtime
|
84
|
-
|
85
|
-
|
86
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
+
name: right_popen
|
89
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
87
90
|
none: false
|
88
91
|
requirements:
|
89
92
|
- - ~>
|
@@ -94,12 +97,12 @@ dependencies:
|
|
94
97
|
- 0
|
95
98
|
- 11
|
96
99
|
version: 1.0.11
|
97
|
-
|
100
|
+
requirement: *id005
|
101
|
+
- !ruby/object:Gem::Dependency
|
98
102
|
prerelease: false
|
99
103
|
type: :runtime
|
100
|
-
|
101
|
-
|
102
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
+
name: msgpack
|
105
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
103
106
|
none: false
|
104
107
|
requirements:
|
105
108
|
- - "="
|
@@ -110,10 +113,7 @@ dependencies:
|
|
110
113
|
- 4
|
111
114
|
- 4
|
112
115
|
version: 0.4.4
|
113
|
-
|
114
|
-
prerelease: false
|
115
|
-
type: :runtime
|
116
|
-
version_requirements: *id006
|
116
|
+
requirement: *id006
|
117
117
|
description: |
|
118
118
|
RightAgent provides a foundation for running an agent on a server to interface
|
119
119
|
in a secure fashion with other agents in the RightScale system. A RightAgent
|