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

Min/Max Pool size modified on every Puppet run adding "" around the values #62

Closed
smbambling opened this issue Jul 22, 2015 · 7 comments

Comments

@smbambling
Copy link
Contributor

I have a datasource resource that I am creating

wildfly::standalone::datasources::datasource { 'jpnDS':
    config => {
      'driver-name'    => 'mysql',
      'min-pool-size'  => '10',
      'max-pool-size'  => '60',
      'connection-url' => 'jdbc:mysql://localhost:3306/DB',
      'jndi-name'      => 'java:jboss/datasources/jpnDS',
      'user-name'      => 'my_app',
      'password'       => 'my_app'
    }
  }

It looks to correctly create the datasource but then on every run it tries to modify the resource to append quotes " around the values.

$ sudo puppet apply --modulepath=/vagrant/modules/ /vagrant/manifests/jboss_wildfly9.pp

Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Faraday: you may want to install system_timer for reliable timeouts
Notice: Compiled catalog for wildfly.example.dev in environment production in 1.22 seconds
Notice: /Stage[main]/Whois_wildfly/Wildfly::Standalone::Datasources::Datasource[jpnDS]/Wildfly::Util::Resource[/subsystem=datasources/data-source=jpnDS]/Wildfly_resource[/subsystem=datasources/data-source=jpnDS]/state: state changed '{"max-pool-size"=>60, "min-pool-size"=>10}' to '{"max-pool-size"=>"60", "min-pool-size"=>"10"}'
Notice: Finished catalog run in 1.13 seconds
@jairojunior
Copy link
Collaborator

If you use 10 and 60 instead of '10' and '60', you'll probably won't have this problem.

This line is problem the source of this issue: https://github.com/biemond/biemond-wildfly/blob/master/lib/puppet/type/wildfly_resource.rb#L51

I'll change this to should.map(&:to_s).sort == is.map(&:to_s).sort in order to force string to string comparison, do some tests and submit a PR.

And thank you for all the issues you're reporting. Don't hesitate to contact me if you're in trouble.

@smbambling
Copy link
Contributor Author

I just tested and using 10 and 60 instead of '10' and '60' and I still see the issue.

@jairojunior
Copy link
Collaborator

I wasn't able to reproduce. Are you using wildfly 9?

@smbambling
Copy link
Contributor Author

Yes 9.0.0 final.

@smbambling
Copy link
Contributor Author

I can look at sanitizing and publishing my vagrant environment if it would help

@jairojunior
Copy link
Collaborator

No need. I tested with Wildfly 9 and was able to reproduce the issue.

As a matter of fact, I did a bad reading of your puppet apply output. Wildfly HTTP API is the one who is returning integers instead of strings. =/

I tested with the change proposed in my first comment and it's working on both versions. I'll submit a PR, but be aware that version 0.4.0 introduces some breaking changes (check CHANGELOG.md for more info).

jairojunior added a commit that referenced this issue Jul 22, 2015
@smbambling
Copy link
Contributor Author

pulled down the 3.7 tag and I can double confirm that its working for me also...thanks for the quick fix!

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