lita-puppet 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/lita/handlers/puppet.rb +2 -0
- data/lita-puppet.gemspec +1 -1
- data/locales/en.yml +1 -0
- data/spec/lita/handlers/puppet_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4093f7f1cf750679f71793b9422435344dfcba71
|
4
|
+
data.tar.gz: 366fb224da2ec58f872484386401c6798645fcde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32cf95a9ed7f69609621ec08c4eb1772047b7f67cf1be37b6ea4b1633ba2b4c3e670fb3b9f3372e2c1384f3dc04b44312164a8670a170aeaca28a602c844e9b2
|
7
|
+
data.tar.gz: 707d26704e241e5638c98e6774e114820ec7551f049c1b273dd0192ac5be24dccda4c8f054f85d3ad264091da9b1b38468db65aafefc5ccf1b0b882e0f49397f
|
data/.travis.yml
CHANGED
data/lib/lita/handlers/puppet.rb
CHANGED
@@ -113,6 +113,8 @@ module Lita
|
|
113
113
|
|
114
114
|
if profiles.is_a? String
|
115
115
|
fail_message response, t('replies.node_profiles.failure', error: profiles)
|
116
|
+
elsif profiles == []
|
117
|
+
fail_message response, t('replies.node_profiles.failure_no_roles', host: host)
|
116
118
|
else
|
117
119
|
success_message(
|
118
120
|
response,
|
data/lita-puppet.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-puppet'
|
3
|
-
spec.version = '2.1.
|
3
|
+
spec.version = '2.1.1'
|
4
4
|
spec.authors = ['Daniel Schaaff', 'Jonathan Gnagy'].sort
|
5
5
|
spec.email = ['jgnagy@knuedge.com']
|
6
6
|
spec.description = 'Some basic Puppet interactions for Lita'
|
data/locales/en.yml
CHANGED
@@ -37,6 +37,7 @@ en:
|
|
37
37
|
notconf: "I would do that, but I don't know how to connect to PuppetDB. Edit my config and add `config.handlers.puppet.puppetdb_url`."
|
38
38
|
working: "let me see what I can find in PuppetDB for you."
|
39
39
|
failure: "Hmmm, that didn't work. Here's what PuppetDB responded with: '%{error}'"
|
40
|
+
failure_no_roles: "The catalog did not contain any roles or profiles for '%{host}'"
|
40
41
|
success: "Here are the %{things} for %{host}:"
|
41
42
|
nodes_with_class:
|
42
43
|
notconf: "I would do that, but I don't know how to connect to PuppetDB. Edit my config and add `config.handlers.puppet.puppetdb_url`."
|
@@ -128,6 +128,18 @@ describe Lita::Handlers::Puppet, lita_handler: true do
|
|
128
128
|
send_command('puppet roles and profiles foo', as: lita_user)
|
129
129
|
expect(replies.last).to eq("/code profile::foo\nrole::baz")
|
130
130
|
end
|
131
|
+
it 'should return error for no profile or role tags' do
|
132
|
+
allow(::PuppetDB::Client).to receive(:get).and_return(
|
133
|
+
'resources' => {
|
134
|
+
'data' => [
|
135
|
+
{ 'tags' => ['baz::foo'] },
|
136
|
+
{ 'tags' => ['bar::baz'] }
|
137
|
+
]
|
138
|
+
}
|
139
|
+
)
|
140
|
+
send_command('puppet roles and profiles foo', as: lita_user)
|
141
|
+
expect(replies.last).to eq("The catalog did not contain any roles or profiles for 'foo'")
|
142
|
+
end
|
131
143
|
end
|
132
144
|
|
133
145
|
describe('#nodes_with_class') do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schaaff
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lita
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
version: '0'
|
226
226
|
requirements: []
|
227
227
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.4.
|
228
|
+
rubygems_version: 2.4.8
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: Allow the Lita bot to handle requests for puppet tasks
|