knife-axe 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/chef/knife/axe_databag.rb +5 -3
  2. metadata +2 -2
@@ -24,12 +24,14 @@ class Chef
24
24
 
25
25
  loader = Chef::Knife::Core::ObjectLoader.new(Chef::DataBagItem, ui)
26
26
 
27
- item_name = File.basename(@name_args[1]).split('.')[0]
27
+ databag=@name_args[0]
28
+ item_file=@name_args[1]
29
+ item_name = File.basename(item_file).split('.')[0]
28
30
  item_ff = loader.load_from("data_bags", databag, item_file)
29
31
  item_fc = Chef::DataBagItem.load(databag, item_ff.to_hash["id"]).raw_data
30
32
 
31
33
  dbag = Chef::DataBagItem.new
32
- dbag.data_bag(@name_args[0])
34
+ dbag.data_bag(databag)
33
35
 
34
36
  diff = Diffy::Diff.new(
35
37
  JSON.pretty_generate(item_fc.to_hash),
@@ -37,7 +39,7 @@ class Chef
37
39
  :context => 1)
38
40
 
39
41
  if diff.to_s(:text).empty?
40
- ui.warn("Role #{role_fc.name} has not been changed")
42
+ ui.warn("Data bag #{databag}/#{item_name} has not been changed")
41
43
  else
42
44
  puts "You are going to update data bag #{databag}/#{item_name}:"
43
45
  puts "\n#{diff.to_s(:color)}\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-axe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-27 00:00:00.000000000 Z
13
+ date: 2014-01-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: diffy