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

Puppet task docker::swarm_token fails, because of frozen string #432

Closed
khaefeli opened this issue Feb 16, 2019 · 4 comments
Closed

Puppet task docker::swarm_token fails, because of frozen string #432

khaefeli opened this issue Feb 16, 2019 · 4 comments
Milestone

Comments

@khaefeli
Copy link
Contributor

khaefeli commented Feb 16, 2019

What you expected to happen?

Puppet Task runs and outputs swarm token.

What happened?

choria.tasks/task-error: The task errored with a code 1 {"_output":""} /opt/puppetlabs/mcollective/tasks-cache/d8bd4ce747fc489e9e7b19cac9776cfde572cfde54813968f4362b5375e19601/swarm_token.rb:10:in swarm_token: can't modify frozen String (FrozenError) from /opt/puppetlabs/mcollective/tasks-cache/d8bd4ce747fc489e9e7b19cac9776cfde572cfde54813968f4362b5375e19601/swarm_token.rb:21:in <main>

How to reproduce it?

mco tasks run docker::swarm_token --node_role manager -I yournode

Anything else we need to know?

https://github.com/puppetlabs/puppetlabs-docker/blob/master/tasks/swarm_token.rb#L2
https://github.com/puppetlabs/puppetlabs-docker/blob/master/tasks/swarm_token.rb#L10
If you create a new instance of the string, it works as expected. (use += instead of <<)

Versions:

$ /opt/puppetlabs/bin/puppet --version
6.2.0

$ docker --version
Docker version 18.03.1-ce, build 9ee9f40

$ facter os
{
  architecture => "amd64",
  distro => {
    codename => "stretch",
    description => "Debian GNU/Linux 9.7 (stretch)",
    id => "Debian",
    release => {
      full => "9.7",
      major => "9",
      minor => "7"
    }
  },
  family => "Debian",
  hardware => "x86_64",
  name => "Debian",
  release => {
    full => "9.7",
    major => "9",
    minor => "7"
  },
  selinux => {
    enabled => false
  }
}
root

Logs:

Paste any relevant logs from a puppet run
@davejrt
Copy link
Contributor

davejrt commented Feb 17, 2019

Hi, we are always happy to take PR's on this module

Would you like to submit a PR with the fix you've identified?

@khaefeli
Copy link
Contributor Author

@davejrt sure, done

@davejrt
Copy link
Contributor

davejrt commented Feb 18, 2019

fixed in #434

@davejrt davejrt closed this as completed Feb 18, 2019
@davejrt davejrt added this to the 3.4.0 milestone Feb 25, 2019
@khaefeli
Copy link
Contributor Author

@davejohnston looks like I forgot the other tasks with the same problem. PR opened

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