23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/chef/knife/spork-databag-create.rb', line 23
def run
self.class.send(:include, KnifeSpork::Runner)
self.config = Chef::Config.merge!(config)
if @name_args.nil?
ui.error "You must specify a data bag name"
ui.error opt_parser
exit 1
end
@object_name = @name_args.first
run_plugins(:before_databagcreate)
pre_databag = {}
databag_create
post_databag = load_databag(@object_name)
@object_difference = json_diff(pre_databag,post_databag).to_s
run_plugins(:after_databagcreate)
end
|