Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 chef/lib/chef/knife/core/node_editor.rb
7 chef/lib/chef/knife/core/node_editor.rb
@@ -61,8 +61,11 @@ def edit_data(text)
61 61 end
62 62
63 63 def apply_updates(updated_data)
64   - # TODO: should warn/error/ask for confirmation when changing the
65   - # name, since this results in a new node, not an edited node.
  64 + if node.name and node.name != updated_data["name"]
  65 + ui.warn "Changing the name of a node results in a new node being created, #{node.name} will not be modified or removed."
  66 + confirm = ui.confirm "Proceed with creation of new node"
  67 + end
  68 +
66 69 @updated_node = Node.new.tap do |n|
67 70 n.name( updated_data["name"] )
68 71 n.chef_environment( updated_data["chef_environment"] )

No commit comments for this range

Something went wrong with that request. Please try again.