kitchen-ansiblepush 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8056cdf92a7a39edb33fe455a7ec05fc8b41fad5
|
4
|
+
data.tar.gz: a11e8d4c8fae927639f30dc7a53cd5db96b9e02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0cff89d94c0a4d27ff77f37ac0f7c9c822cc8f9a08b8f65b01c892efdfdd586d8a5c2d6c1363d9d2b726cca56e8e770a794ecae0dbcee6557d2ab9259e81fb7
|
7
|
+
data.tar.gz: 63390d61cdb8d5a38dad2cd669e46c33a6c4c637e1f90d7bfaa25143b0626f60297a61de71c73742aefd9485a397960a8b76f738c32ccd04eb0ef7d8b1a32da1
|
@@ -2,20 +2,35 @@ import json
|
|
2
2
|
import os
|
3
3
|
import errno
|
4
4
|
|
5
|
-
|
5
|
+
try:
|
6
|
+
from ansible.plugins.callback import CallbackBase
|
7
|
+
except ImportError:
|
8
|
+
print "Fallback to Ansible 1.x compatibility"
|
9
|
+
CallbackBase = object
|
10
|
+
|
11
|
+
class CallbackModule(CallbackBase):
|
12
|
+
"""
|
13
|
+
This Ansible callback plugin flags idempotency tests failures
|
14
|
+
"""
|
15
|
+
CALLBACK_VERSION = 2.0
|
16
|
+
CALLBACK_TYPE = 'notification'
|
17
|
+
CALLBACK_NAME = 'changes'
|
18
|
+
CALLBACK_NEEDS_WHITELIST = True
|
19
|
+
|
6
20
|
def __init__(self):
|
21
|
+
super(CallbackModule, self).__init__()
|
22
|
+
|
7
23
|
self.change_file = os.getenv('PLUGIN_CHANGES_FILE', "/tmp/kitchen_ansible_callback/changes")
|
8
24
|
change_dir = os.path.dirname(self.change_file)
|
9
25
|
if not os.path.exists(change_dir):
|
10
26
|
os.makedirs(change_dir)
|
11
|
-
|
27
|
+
|
12
28
|
try:
|
13
29
|
os.remove(self.change_file)
|
14
30
|
except OSError as e: # this would be "except OSError, e:" before Python 2.6
|
15
31
|
if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory
|
16
32
|
raise # re-raise exception if a different error occured
|
17
33
|
|
18
|
-
|
19
34
|
|
20
35
|
def write_changed_to_file(self, host, res, name=None):
|
21
36
|
changed_data = dict()
|
data/kitchen-ansiblepush.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.licenses = ['MIT']
|
12
12
|
gem.homepage = "https://github.com/ahelal/kitchen-ansiblepush"
|
13
13
|
gem.summary = "ansible provisioner for test-kitchen"
|
14
|
-
candidates = Dir.glob("{lib}/**/*") + ['README.md', 'kitchen-ansiblepush.gemspec', 'callback/
|
14
|
+
candidates = Dir.glob("{lib}/**/*") + ['README.md', 'kitchen-ansiblepush.gemspec', 'callback/changes.py']
|
15
15
|
gem.files = candidates.sort
|
16
16
|
gem.platform = Gem::Platform::RUBY
|
17
17
|
gem.require_paths = ['lib']
|
@@ -39,6 +39,7 @@ module Kitchen
|
|
39
39
|
default_config :generate_inv_path, "`which kitchen-ansible-inventory`"
|
40
40
|
default_config :raw_arguments, nil
|
41
41
|
default_config :idempotency_test, false
|
42
|
+
default_config :fail_non_idempotent, true
|
42
43
|
|
43
44
|
# For tests disable if not needed
|
44
45
|
default_config :chef_bootstrap_url, "https://www.getchef.com/chef/install.sh"
|
@@ -234,8 +235,11 @@ module Kitchen
|
|
234
235
|
info(" #{task}> #{line.strip}")
|
235
236
|
end
|
236
237
|
end
|
237
|
-
|
238
|
-
|
238
|
+
if conf[:fail_non_idempotent]
|
239
|
+
raise "idempotency test Failed. Number of non idempotent tasks: #{task}"
|
240
|
+
else
|
241
|
+
info("Warning idempotency test [failed]")
|
242
|
+
end
|
239
243
|
else
|
240
244
|
info("idempotency test [passed]")
|
241
245
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-ansiblepush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adham Helal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -69,7 +69,7 @@ extensions: []
|
|
69
69
|
extra_rdoc_files: []
|
70
70
|
files:
|
71
71
|
- README.md
|
72
|
-
- callback/
|
72
|
+
- callback/changes.py
|
73
73
|
- kitchen-ansiblepush.gemspec
|
74
74
|
- lib/kitchen-ansible/util-inventory.rb
|
75
75
|
- lib/kitchen-ansible/version.rb
|