Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Modify Frozen String #118

Closed
smford22 opened this issue Feb 14, 2017 · 1 comment
Closed

Can't Modify Frozen String #118

smford22 opened this issue Feb 14, 2017 · 1 comment
Assignees

Comments

@smford22
Copy link

Version:

$ chef gem list knife-google

*** LOCAL GEMS ***

knife-google (3.1.0)

Environment: [Details about the environment such as the Operating System, cookbook details, etc...]

Windows 7 Enterprise
ChefDK 1.1.16

Scenario:

knife google server create "chef-knife-test" --gce-project "project-name" --gce-zone "zone"  --gce-machine-type "n1-standard-1" --gce-subnet "compute-uswest" --gce-network "development" --gce-service-account-scopes “<LIST OF SCOPES>” --gce-tags "no-ip","webservices" --gce-image "compute-golden2" --gce-image-project "project-id" --gce-boot-disk-size "10" -x “username” -i “path-to-key” --sudo -r 'role[base_linux]'

Steps to Reproduce:

Run the above command

Expected Result:

A server should be created

Actual Result:

Output shows an error can't modify frozen string

Running with -VV shows an error on ../knife-google-3.1.0/lib/chef/knife/cloud/google_service:248:in downcase!: can't modify a frozen string

247:     def valid_public_ip_setting?(public_ip)
    248: require 'pry';binding.pry
=> 249:       public_ip.downcase! if public_ip.respond_to?(:downcase)
    250:
    251:       if public_ip.nil? || public_ip == "ephemeral" || public_ip == "none"
    252:         true
    253:       elsif valid_ip_address?(public_ip)
    254:         true
    255:       else
    256:         false
    257:       end
    258:     end
[1] pry(#<Chef::Knife::Cloud::GoogleService>)> public_ip
=> "EPHEMERAL"
[2] pry(#<Chef::Knife::Cloud::GoogleService>)> public_ip.downcase! if public_ip.respond_to?(:downcase)
RuntimeError: can't modify frozen String
from (pry):2:in `downcase!'
[3] pry(#<Chef::Knife::Cloud::GoogleService>)> public_ip.downcase if public_ip.respond_to?(:downcase)
=> "ephemeral"
[4] pry(#<Chef::Knife::Cloud::GoogleService>)>
@jjasghar jjasghar self-assigned this Feb 14, 2017
jjasghar pushed a commit that referenced this issue Feb 17, 2017
Removed the !downcase per frozen_string_literal
Resolves #118

Signed-off-by: JJ Asghar <jj@chef.io>
@jjasghar jjasghar mentioned this issue Feb 17, 2017
@jjasghar
Copy link

#119 This fixes this issue.

jjasghar pushed a commit that referenced this issue Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants