lita-puppet 2.1.0 → 2.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1b3f7b216de57ce1507c62606049abe09c4a6d7
4
- data.tar.gz: bf814b1efdb2b666499d4df0149fe28bbbeff81d
3
+ metadata.gz: 4093f7f1cf750679f71793b9422435344dfcba71
4
+ data.tar.gz: 366fb224da2ec58f872484386401c6798645fcde
5
5
  SHA512:
6
- metadata.gz: 0b01deb2674c47f115759323cae6093828d2aa9d5c727068c3f97edd1e83b69957d4c029682cf07ddaf6a3dc2b6ca8399d9c592a9ca1b64cb2cadc631ff28ed3
7
- data.tar.gz: 40617d283ae66ef75a502f68ebcced9c35e126b5227e3057b96f62f92f972b2d557569463729199a5b7fe8d5f4f2b6f37a50dcc407e2d6581c9da6768396ace8
6
+ metadata.gz: 32cf95a9ed7f69609621ec08c4eb1772047b7f67cf1be37b6ea4b1633ba2b4c3e670fb3b9f3372e2c1384f3dc04b44312164a8670a170aeaca28a602c844e9b2
7
+ data.tar.gz: 707d26704e241e5638c98e6774e114820ec7551f049c1b273dd0192ac5be24dccda4c8f054f85d3ad264091da9b1b38468db65aafefc5ccf1b0b882e0f49397f
data/.travis.yml CHANGED
@@ -2,6 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 2.2.5
4
4
  - 2.3.1
5
+ - 2.4.1
5
6
  services:
6
7
  - redis-server
7
8
  cache: bundler
@@ -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.0'
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.0
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-10 00:00:00.000000000 Z
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.5
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