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

"Argument Error: Negative Argument" when attempting to fix resource definition with hash args #827

Closed
abegosum opened this issue Jul 5, 2018 · 1 comment

Comments

@abegosum
Copy link

abegosum commented Jul 5, 2018


puppet-lint version: 2.3.5
ruby version: 2.3.1-p112
platform: x86_64-linux-gnu
file path: ./manifests/axiameter.pp
file contents:

# profile class for axia meter
class profiles::axiameter
{
  require ::profiles::apache::conf::graphite
  require ::profiles::sysctl::axia
  require ::profiles::packages::cifs::utils


  ::profiles::apache::vhost::php { 'hqbcaxiameter01.mpr.org' :
    vhost_file        => '/etc/httpd/sites.d/hqbcaxiameter01.mpr.org.conf',
    app_name          => 'hqbcaxiameter01',
    server_alias      => [ 'hqbcaxiameter01.*.mpr.org',
                           'hqffmpeg01', ],
    document_root     => '/WWW/web-home/hqbcaxiameter01/',
    directories       => [ { 'path' => '/WWW/web-home/hqbcaxiameter01/',
                             'additional_config' => [ 'AllowOverride All' ] }, ],
    additional_config => [ '<IfModule mod_headers.c>',
                           '   Header set Access-Control-Allow-Origin "*"',
                           '</IfModule>', ],
  }
}

error:

ArgumentError: negative argument
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb:105:in `*'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb:105:in `fix'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/checkplugin.rb:42:in `block in fix_problems'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/checkplugin.rb:38:in `each'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/checkplugin.rb:38:in `fix_problems'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/checks.rb:63:in `block in run'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/checks.rb:57:in `each'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/checks.rb:57:in `run'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint.rb:205:in `run'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/bin.rb:66:in `block in run'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/bin.rb:62:in `each'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/lib/puppet-lint/bin.rb:62:in `run'
/var/lib/gems/2.3.0/gems/puppet-lint-2.3.5/bin/puppet-lint:7:in `<top (required)>'
/usr/local/bin/puppet-lint:23:in `load'
/usr/local/bin/puppet-lint:23:in `<main>'

I seem to be able to manually work around it if I manually align the => operators in the directories hash:

    directories       => [ { 'path'              => '/WWW/web-home/hqbcaxiameter01/',
                             'additional_config' => [ 'AllowOverride All' ] }, ],
@rodjek
Copy link
Owner

rodjek commented Jul 9, 2018

Duplicate of #771, fixed in #819, and will be part of the 2.3.6 release

@rodjek rodjek closed this as completed Jul 9, 2018
@rodjek rodjek added this to the 2.3.6 milestone Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants