lib/chef/knife/openstack_server_create.rb in knife-openstack-2.1.7 vs lib/chef/knife/openstack_server_create.rb in knife-openstack-3.0.1
- old
+ new
@@ -1,10 +1,11 @@
#
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Author:: Matt Ray (<matt@chef.io>)
# Author:: Chirag Jog (<chirag@clogeny.com>)
-# Copyright:: Copyright 2011-2018 Chef Software, Inc.
+# Author:: Lance Albertson (<lance@osuosl.org>)
+# Copyright:: Copyright 2011-2020 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -173,15 +174,15 @@
# set param vm_name to a random value if the name is not set by the user (plugin)
config[:chef_node_name] = get_node_name(locate_config_value(:chef_node_name), locate_config_value(:chef_node_name_prefix))
errors = []
- if locate_config_value(:bootstrap_protocol) == "winrm"
- if locate_config_value(:winrm_password).nil?
- errors << "You must provide Winrm Password."
+ if locate_config_value(:connection_protocol) == "winrm"
+ if locate_config_value(:connection_password).nil?
+ errors << "You must provide Connection Password."
end
- elsif locate_config_value(:bootstrap_protocol) != "ssh"
+ elsif locate_config_value(:connection_protocol) != "ssh"
errors << "You must provide a valid bootstrap protocol. options [ssh/winrm]. For linux type images, options [ssh]"
end
errors << "You must provide --image-os-type option [windows/linux]" unless %w{windows linux}.include?(locate_config_value(:image_os_type))
error_message = ""
@@ -205,19 +206,19 @@
return false if addresses.empty? # no floating IPs
# floating requested without value
if address.nil?
if addresses.find_index { |a| a.fixed_ip.nil? }
- return true
+ true
else
- return false # no floating IPs available
+ false # no floating IPs available
end
else
# floating requested with value
if addresses.find_index { |a| a.ip == address }
- return true
+ true
else
- return false # requested floating IP does not exist
+ false # requested floating IP does not exist
end
end
end
def post_connection_validations