lib/chef/knife/cloud/google_service.rb in knife-google-3.0.0 vs lib/chef/knife/cloud/google_service.rb in knife-google-3.1.0
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
#
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
# Copyright:: Copyright (c) 2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
@@ -406,10 +407,12 @@
Array(interface)
end
def instance_access_configs_for(public_ip)
- return [] if public_ip.nil? || public_ip == "NONE"
+ public_ip.downcase! if public_ip.respond_to?(:downcase)
+
+ return [] if public_ip.nil? || public_ip == "none"
access_config = Google::Apis::ComputeV1::AccessConfig.new
access_config.name = "External NAT"
access_config.type = "ONE_TO_ONE_NAT"
access_config.nat_ip = public_ip if valid_ip_address?(public_ip)