Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code review PR #5

Open
wants to merge 56 commits into
base: empty
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
8451873
initail version
BernhardDenner Nov 25, 2016
dc643f8
rename kdbkey/libelektra provider to kdbkey/ruby
BernhardDenner Nov 25, 2016
70edff4
gitignore: add vim swap files
BernhardDenner Nov 25, 2016
60e5d46
ruby provider: meta data and comments handling
BernhardDenner Dec 3, 2016
b81a315
ruby provider: add code comments
BernhardDenner Dec 3, 2016
a89a351
new attr `purge_meta_keys`, correctely handle comments
BernhardDenner Dec 5, 2016
9132586
add first rspec test cases
BernhardDenner Dec 6, 2016
a3dc82d
add stubs for unimplemented test cases
BernhardDenner Dec 6, 2016
0a2834a
kdbmount custom type and provider (kdb)
BernhardDenner Dec 6, 2016
4f53d7d
readme stub
BernhardDenner Dec 21, 2016
776e5d3
kdbmount Ruby provider
BernhardDenner Feb 20, 2017
7994bf2
kdbkey type: add prefix parameter
BernhardDenner Feb 23, 2017
a6d2bc1
kdbkey: implement user parameter
BernhardDenner Feb 23, 2017
5691017
type kdbkey: keep name and title in sync
BernhardDenner Feb 23, 2017
2048883
provider kdbkey kdb: implement unit tests
BernhardDenner Feb 23, 2017
73f7b8c
gitignore: Gemfile.log
BernhardDenner Feb 23, 2017
9eb313d
kdbkey provider kdb: implement metadata handling
BernhardDenner Feb 23, 2017
d6d4241
kdbkey provider kdb: implement comment handling
BernhardDenner Feb 24, 2017
5458597
kdbkey provider: implement unit test
BernhardDenner Feb 24, 2017
ead052a
kdbmount type: add additional unit tests
BernhardDenner Feb 26, 2017
e1a674f
test cases: do not use global variable TEST_NS
BernhardDenner Feb 26, 2017
9744732
kdbkey: handle metadata updates correctly
BernhardDenner Feb 26, 2017
5b62e8b
kdbkey: implement 'check' property (test restructure)
BernhardDenner Feb 28, 2017
2c87bd0
kdbkey: ruby provider is always the default
BernhardDenner Feb 28, 2017
9bd6de7
kdbkey: autorequire kdbmounts
BernhardDenner Feb 28, 2017
fc30dac
kdbkey provider ruby: kdb.open/get for each managed key
BernhardDenner Feb 28, 2017
cf3e6f0
kdbkey kdb provider: fix missing spec creation
BernhardDenner Feb 28, 2017
debdc13
kdbkey provider: check with array fix
BernhardDenner Mar 13, 2017
8a43527
kdbkey provider: add missing require 'common'
BernhardDenner Mar 19, 2017
a9019b7
kdbkey: manage elektra array values
BernhardDenner Mar 21, 2017
baab4a6
kdbkey: fix removal of arrays
BernhardDenner Mar 21, 2017
5dd2c72
kdbkey: only use error message for exception
BernhardDenner Mar 21, 2017
309414a
kdbkey: provide custom 'change' message
BernhardDenner Mar 21, 2017
692be1a
kdbkey: add docu for array handling of value property
BernhardDenner Mar 21, 2017
dc22b90
more useless examples
BernhardDenner Mar 21, 2017
bc4235d
kdbkey ruby: add check metadata also to the resource key
BernhardDenner Mar 24, 2017
90ac4e9
kdbkey: autorequire all parent key names
BernhardDenner Mar 27, 2017
508ecae
kdbkey ruby provider: fix test cases for set spec
BernhardDenner Mar 28, 2017
6323959
kdbkey ruby provider: implement 'user' param
BernhardDenner Mar 28, 2017
a6a0dfd
kdbkey ruby provider: add missing has_feature :user
BernhardDenner Mar 28, 2017
1da8e4c
update readme
BernhardDenner Mar 28, 2017
31ea529
small fixes
markus2330 Apr 7, 2017
19cc201
Merge pull request #2 from ElektraInitiative/markus2330-patch-1
BernhardDenner Apr 7, 2017
3869e79
kdbmount: default 'true' for add_recommended_plugins
BernhardDenner Apr 21, 2017
d7fcfa7
kdbmount kdb: remove old 'puts' debugging code
BernhardDenner Apr 23, 2017
a64b5c0
kdbmount: fix exception handling
BernhardDenner Apr 27, 2017
5bfcfbf
kdbmount: make :file and :plugins mandatory
BernhardDenner Apr 27, 2017
b80dd26
kdbmount: fix updating of plugins (ruby)
BernhardDenner Apr 27, 2017
14ba302
Merge pull request #3 from BernhardDenner/kdbmount_fixes
BernhardDenner Apr 27, 2017
f3d2c04
kdbkey: fix array index names greater >= 10
BernhardDenner May 6, 2017
e56f155
kdbkey: handle comments in a uniform way
BernhardDenner Apr 28, 2017
4095a7b
set version to 0.8.1
BernhardDenner May 6, 2017
789064e
Merge pull request #4 from BernhardDenner/master
BernhardDenner May 6, 2017
8f3d1cb
kdbmount: fix plugins parameter handling for kdb provider
BernhardDenner Jun 15, 2017
24cd9d4
use require_relative to source the common provider
BernhardDenner Nov 6, 2017
bbb9b57
Merge pull request #6 from BernhardDenner/fix_kdbkey_provider_require…
BernhardDenner Nov 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
kdbkey ruby: add check metadata also to the resource key
This ensures, that the check can be performed even if the spec_key is
just created (in the same kdb.set operation).
Otherwise we could end up creating keys with invalid values
BernhardDenner committed Mar 24, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bc4235d56dd8c7fa9cd36d3f40d1cb8063798747
2 changes: 1 addition & 1 deletion examples/kdbkey.pp
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@
# (see '$> kdb info type' for other types)
kdbkey { 'spec/x1':
prefix => $ns_validation,
value => 7,
value => 11,
check => {
'range' => '0-10'
},
9 changes: 9 additions & 0 deletions lib/puppet/provider/kdbkey/ruby.rb
Original file line number Diff line number Diff line change
@@ -302,12 +302,21 @@ def check=(value)
# set meta data on spec_key
spec_to_set.each do |spec_name, spec_value|
spec_key[spec_name] = spec_value
# also add the check meta data to resource_key directly, they will get
# removed by the 'spec' plugin (it the bug is fixed ;)
# This is required, since the check is only evaluated if the key has the
# appropriate metadata attached. If the spec_key is created with the same
# keyset, the resources value will be set before the check can be performed
# so we end up with an invalid value for the setting.
@resource_key[spec_name] = spec_value
end

# remove all not specified meta keys from spec_key starting with 'check'
spec_key.meta.each do |e|
if e.name.start_with? "check" and !spec_to_set.include? e.name
spec_key.del_meta e.name
# perform same operation on resource_key
@resource_key.del_meta e.name
end
end
end