summaryrefslogtreecommitdiff
path: root/lib/chef/resource/hostname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/hostname.rb')
-rw-r--r--lib/chef/resource/hostname.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 87d7328ad3..ac4e1c98c0 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -65,7 +65,7 @@ class Chef
# @return [String]
def updated_ec2_config_xml
begin
- require "rexml/document"
+ require "rexml/document" unless defined?(REXML::Document)
config_file = 'C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml'
config = REXML::Document.new(::File.read(config_file))
# find an element named State with a sibling element whose value is Ec2SetComputerName