Skip to content

Commit

Permalink
Merge pull request #119 from chef/118_fix
Browse files Browse the repository at this point in the history
Fix for #118
  • Loading branch information
JJ Asghar authored Feb 17, 2017
2 parents a1341ef + 6e9d74e commit 0a41e91
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/chef/knife/cloud/google_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,10 @@ def image_exist?(image_project, image_name)
end

def valid_public_ip_setting?(public_ip)
public_ip.downcase! if public_ip.respond_to?(:downcase)

if public_ip.nil? || public_ip == "ephemeral" || public_ip == "none"
case
when public_ip.nil? || public_ip.match(/(ephemeral|none)/i)
true
elsif valid_ip_address?(public_ip)
when valid_ip_address?(public_ip)
true
else
false
Expand Down Expand Up @@ -409,9 +408,7 @@ def instance_network_interfaces_for(options)
end

def instance_access_configs_for(public_ip)
public_ip.downcase! if public_ip.respond_to?(:downcase)

return [] if public_ip.nil? || public_ip == "none"
return [] if public_ip.nil? || public_ip.match(/none/i)

access_config = Google::Apis::ComputeV1::AccessConfig.new
access_config.name = "External NAT"
Expand Down

0 comments on commit 0a41e91

Please sign in to comment.