stacksondeck 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +3 -1
- data/VERSION +1 -1
- data/lib/stacksondeck/app.rb +2 -2
- data/lib/stacksondeck/main.rb +10 -2
- data/lib/stacksondeck/mjolnir.rb +0 -25
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 935257ae88643f86d0fed066e61ad135f3077774
|
4
|
+
data.tar.gz: fc8e391ff90a0f0f546c4e0a8bb84a494aab3ac4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d8b2735dc60798e0a8c8e7928d36153059dd62436dc3ec6038b11161a541dbfdd90a257108247c05829d6fcad1d3c3de0ec241eb32f8418244e74917a2615d3
|
7
|
+
data.tar.gz: c9ab5285ab411e192b12e15ba2981a431290d0749696cc49ca22120049f9371961f389980eb26b8c74db737fb37c170ad2221564e5bb864818c9fb987ad3b242
|
data/Readme.md
CHANGED
@@ -42,6 +42,8 @@ You're most likely inteterested in the `server` command:
|
|
42
42
|
-r, [--refresh=N] # Refresh interval in seconds
|
43
43
|
# Default: 900
|
44
44
|
-h, [--hints=HINTS] # JSON file with node hints
|
45
|
+
-q, [--query=QUERY] # Query to find nodes
|
46
|
+
# Default: name:*
|
45
47
|
-l, [--log=LOG] # Log to file instead of STDOUT
|
46
48
|
-v, [--debug], [--no-debug] # Enable DEBUG-level logging
|
47
49
|
-z, [--trace], [--no-trace] # Enable TRACE-level logging
|
@@ -113,4 +115,4 @@ Return the application version:
|
|
113
115
|
|
114
116
|
#### v1.0.0
|
115
117
|
|
116
|
-
- Stupid simple Chef-Rundeck integration
|
118
|
+
- Stupid simple Chef-Rundeck integration
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/lib/stacksondeck/app.rb
CHANGED
@@ -77,7 +77,7 @@ module StacksOnDeck
|
|
77
77
|
|
78
78
|
hints = refresh_hints!
|
79
79
|
|
80
|
-
nodes = @@ridley.partial_search :node,
|
80
|
+
nodes = @@ridley.partial_search :node, settings.query, %w[
|
81
81
|
name
|
82
82
|
hostname
|
83
83
|
fqdn
|
@@ -143,4 +143,4 @@ module StacksOnDeck
|
|
143
143
|
|
144
144
|
|
145
145
|
end
|
146
|
-
end
|
146
|
+
end
|
data/lib/stacksondeck/main.rb
CHANGED
@@ -71,6 +71,12 @@ module StacksOnDeck
|
|
71
71
|
aliases: %w[ -h ],
|
72
72
|
desc: 'JSON file with node hints',
|
73
73
|
required: false
|
74
|
+
option :query, \
|
75
|
+
type: :string,
|
76
|
+
aliases: %w[ -q ],
|
77
|
+
desc: 'Query to find nodes',
|
78
|
+
default: 'name:*',
|
79
|
+
required: false
|
74
80
|
include_common_options
|
75
81
|
def server
|
76
82
|
App.set :log, log
|
@@ -81,6 +87,7 @@ module StacksOnDeck
|
|
81
87
|
App.set :username, options.username
|
82
88
|
App.set :environment, options.environment
|
83
89
|
App.set :hints, options.hints
|
90
|
+
App.set :query, options.query
|
84
91
|
|
85
92
|
if options.debug?
|
86
93
|
App.set :raise_errors, true
|
@@ -89,11 +96,12 @@ module StacksOnDeck
|
|
89
96
|
App.set :logging, ::Logger::DEBUG
|
90
97
|
end
|
91
98
|
|
92
|
-
Celluloid.logger = options.
|
99
|
+
Celluloid.logger = options.debug? ? log : nil
|
100
|
+
Ridley::Logging.set_logger log if options.debug?
|
93
101
|
|
94
102
|
log.info event: 'server', options: options
|
95
103
|
App.run!
|
96
104
|
end
|
97
105
|
|
98
106
|
end
|
99
|
-
end
|
107
|
+
end
|
data/lib/stacksondeck/mjolnir.rb
CHANGED
@@ -20,12 +20,6 @@ module StacksOnDeck
|
|
20
20
|
aliases: %w[ -v ],
|
21
21
|
desc: 'Enable DEBUG-level logging',
|
22
22
|
default: ENV['SOD_DEBUG'] || false
|
23
|
-
},
|
24
|
-
trace: {
|
25
|
-
type: :boolean,
|
26
|
-
aliases: %w[ -z ],
|
27
|
-
desc: 'Enable TRACE-level logging',
|
28
|
-
default: ENV['SOD_TRACE'] || false
|
29
23
|
}
|
30
24
|
}
|
31
25
|
|
@@ -39,30 +33,11 @@ module StacksOnDeck
|
|
39
33
|
|
40
34
|
no_commands do
|
41
35
|
|
42
|
-
# Return a connection to the given OpenStack service
|
43
|
-
def os service
|
44
|
-
@os ||= {}
|
45
|
-
return @os[service] if @os.has_key? service
|
46
|
-
@os[service] = OpenStack::Connection.create \
|
47
|
-
auth_url: options.auth_url,
|
48
|
-
auth_method: options.auth_method,
|
49
|
-
authtenant_id: options.auth_tenant,
|
50
|
-
username: options.auth_user,
|
51
|
-
api_key: options.auth_pass,
|
52
|
-
service_type: service
|
53
|
-
log.trace \
|
54
|
-
event: 'OpenStack connection',
|
55
|
-
service: service
|
56
|
-
return @os[service]
|
57
|
-
end
|
58
|
-
|
59
|
-
|
60
36
|
# Construct a Logger given the command-line options
|
61
37
|
def log
|
62
38
|
return @logger if defined? @logger
|
63
39
|
level = :info
|
64
40
|
level = :debug if options.debug?
|
65
|
-
level = :trace if options.trace?
|
66
41
|
device = options.log || $stderr
|
67
42
|
pretty = device.tty? rescue false
|
68
43
|
@logger = Slog.new \
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stacksondeck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hashie
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sinatra
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|