Skip to content

Commit

Permalink
Fix issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
christine_draper committed Dec 15, 2015
1 parent a238d75 commit 3f962ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/chef/knife/topo/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Knife
module Topo
VERSION = "1.1.1"
VERSION = "1.1.2"
end
end
2 changes: 1 addition & 1 deletion lib/chef/knife/topo_cookbook_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def print_priority_attrs(file, attrs, indent=0)

# Print out qualified attributes
def print_qualified_attr(file, qualifier_hash)
file.puts "if node['topo']['#{qualifier_hash['qualifier']}'] == \"#{qualifier_hash['value']}\""
file.puts "if node['topo'] && node['topo']['#{qualifier_hash['qualifier']}'] == \"#{qualifier_hash['value']}\""
print_priority_attrs(file, qualifier_hash, 2)
file.puts "end"
end
Expand Down
4 changes: 2 additions & 2 deletions lib/chef/knife/topo_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def remove_node_from_topology(node_name)
# load then update and save the node
node = Chef::Node.load(node_name)

if node.normal['topo'] && node.normal['topo']['name'] == @topo_name
node.normal['topo'].delete('name')
if node['topo'] && node['topo']['name'] == @topo_name
node.rm('topo','name')
ui.info "Removing node #{node.name} from topology"
node.save
end
Expand Down
8 changes: 6 additions & 2 deletions lib/chef/knife/topo_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ class TopoList < Chef::Knife

def run

topo_bag = topo_bag_name(config[:data_bag])
output(format_list_for_display(Chef::DataBag.load(topo_bag)))
begin
topo_bag = topo_bag_name(config[:data_bag])
output(format_list_for_display(Chef::DataBag.load(topo_bag)))
rescue Net::HTTPServerException => e
raise unless e.to_s =~ /^404/
end

end

Expand Down

0 comments on commit 3f962ca

Please sign in to comment.