Page MenuHomePhabricator

fix all "top-scope variable being used without an explicit namespace" across the puppet repo
Closed, ResolvedPublic

Description

from our global .puppet-lint.rc in the puppet repo:

1 # We still use the 2.6 way of referencing variables
2 # 2.8 will requires $::globalname. Skip for now.
3 --no-variable_scope-check

So we need to fix all of those.
After fixing all of them we can remove the above lines from the global lint config

Remaining occurrences:

[tim@passepartout ~/src/operations/puppet]$ (cd / && puppet-lint --only-checks variable_scope $OLDPWD)
/home/tim/src/operations/puppet/modules/toollabs/manifests/mailrelay.pp - WARNING: top-scope variable being used without an explicit namespace on line 22
/home/tim/src/operations/puppet/modules/toollabs/manifests/mailrelay.pp - WARNING: top-scope variable being used without an explicit namespace on line 26
/home/tim/src/operations/puppet/modules/gridengine/manifests/resourcedir.pp - WARNING: top-scope variable being used without an explicit namespace on line 15
/home/tim/src/operations/puppet/modules/gridengine/manifests/resourcedir.pp - WARNING: top-scope variable being used without an explicit namespace on line 19
/home/tim/src/operations/puppet/modules/gridengine/manifests/resourcedir.pp - WARNING: top-scope variable being used without an explicit namespace on line 20
/home/tim/src/operations/puppet/modules/varnishkafka/manifests/instance.pp - WARNING: top-scope variable being used without an explicit namespace on line 130
/home/tim/src/operations/puppet/modules/eventlogging/manifests/service/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 88
/home/tim/src/operations/puppet/modules/eventlogging/manifests/service/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 97
/home/tim/src/operations/puppet/modules/eventlogging/manifests/service/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 103
/home/tim/src/operations/puppet/modules/mysql/manifests/server/package.pp - WARNING: top-scope variable being used without an explicit namespace on line 20
/home/tim/src/operations/puppet/modules/labs_vmbuilder/manifests/init.pp - WARNING: top-scope variable being used without an explicit namespace on line 68
/home/tim/src/operations/puppet/modules/logstash/manifests/output/elasticsearch/scripts.pp - WARNING: top-scope variable being used without an explicit namespace on line 7
/home/tim/src/operations/puppet/modules/logstash/manifests/output/elasticsearch/scripts.pp - WARNING: top-scope variable being used without an explicit namespace on line 15
/home/tim/src/operations/puppet/modules/logstash/manifests/output/elasticsearch/scripts.pp - WARNING: top-scope variable being used without an explicit namespace on line 23
/home/tim/src/operations/puppet/modules/logstash/manifests/output/statsd.pp - WARNING: top-scope variable being used without an explicit namespace on line 57
/home/tim/src/operations/puppet/modules/lvs/manifests/configuration.pp - WARNING: top-scope variable being used without an explicit namespace on line 56
/home/tim/src/operations/puppet/modules/monitoring/manifests/ganglia.pp - WARNING: top-scope variable being used without an explicit namespace on line 97
/home/tim/src/operations/puppet/modules/monitoring/manifests/ganglia.pp - WARNING: top-scope variable being used without an explicit namespace on line 99
/home/tim/src/operations/puppet/modules/monitoring/manifests/host.pp - WARNING: top-scope variable being used without an explicit namespace on line 21
/home/tim/src/operations/puppet/modules/monitoring/manifests/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 24
/home/tim/src/operations/puppet/modules/puppet/manifests/self/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 52
/home/tim/src/operations/puppet/modules/puppetmaster/manifests/gitclone.pp - WARNING: top-scope variable being used without an explicit namespace on line 54
/home/tim/src/operations/puppet/modules/puppetmaster/manifests/init.pp - WARNING: top-scope variable being used without an explicit namespace on line 87
/home/tim/src/operations/puppet/modules/role/manifests/cache/kafka/webrequest.pp - WARNING: top-scope variable being used without an explicit namespace on line 17
/home/tim/src/operations/puppet/modules/role/manifests/cache/kafka/eventlogging.pp - WARNING: top-scope variable being used without an explicit namespace on line 7
/home/tim/src/operations/puppet/modules/role/manifests/cache/kafka/statsv.pp - WARNING: top-scope variable being used without an explicit namespace on line 19
/home/tim/src/operations/puppet/modules/role/manifests/ganglia/web.pp - WARNING: top-scope variable being used without an explicit namespace on line 20
/home/tim/src/operations/puppet/modules/role/manifests/osm/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 54
/home/tim/src/operations/puppet/modules/role/manifests/osm/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 66
/home/tim/src/operations/puppet/modules/role/manifests/osm/slave.pp - WARNING: top-scope variable being used without an explicit namespace on line 16
/home/tim/src/operations/puppet/modules/role/manifests/postgres/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 22
/home/tim/src/operations/puppet/modules/role/manifests/postgres/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 34
/home/tim/src/operations/puppet/modules/role/manifests/postgres/slave.pp - WARNING: top-scope variable being used without an explicit namespace on line 12
/home/tim/src/operations/puppet/modules/udp2log/manifests/instance/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 43
/home/tim/src/operations/puppet/manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 285
/home/tim/src/operations/puppet/manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 291
/home/tim/src/operations/puppet/manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 297
/home/tim/src/operations/puppet/manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 303
/home/tim/src/operations/puppet/manifests/role/mariadb.pp - WARNING: top-scope variable being used without an explicit namespace on line 776
[tim@passepartout ~/src/operations/puppet]$

Event Timeline

Dzahn raised the priority of this task from to Needs Triage.
Dzahn updated the task description. (Show Details)
Dzahn added a project: SRE.
Dzahn added a subscriber: Dzahn.
scfc added a subscriber: scfc.

I'm never quite sure if and how this applies to templates as well (not the lint warning, but the underlying issue), so if someone has investigated that, a short summary would be appreciated.

@scfc regarding the remaining issues, i think we should just put "lint-ignore" lines around the tricky ones, since it's such a small percentage remaining compared to the ones already fixed. and then switch the global .puppet-lint.rc

left now:

./modules/cdh/manifests/spark.pp - WARNING: top-scope variable being used without an explicit namespace on line 73
./modules/monitoring/manifests/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 24
./modules/monitoring/manifests/host.pp - WARNING: top-scope variable being used without an explicit namespace on line 21
./modules/monitoring/manifests/ganglia.pp - WARNING: top-scope variable being used without an explicit namespace on line 97
./modules/monitoring/manifests/ganglia.pp - WARNING: top-scope variable being used without an explicit namespace on line 99
./modules/logstash/manifests/output/statsd.pp - WARNING: top-scope variable being used without an explicit namespace on line 57
./modules/logstash/manifests/output/elasticsearch/scripts.pp - WARNING: top-scope variable being used without an explicit namespace on line 7
./modules/logstash/manifests/output/elasticsearch/scripts.pp - WARNING: top-scope variable being used without an explicit namespace on line 15
./modules/logstash/manifests/output/elasticsearch/scripts.pp - WARNING: top-scope variable being used without an explicit namespace on line 23
./modules/labs_vmbuilder/manifests/init.pp - WARNING: top-scope variable being used without an explicit namespace on line 68
./modules/eventlogging/manifests/service/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 88
./modules/eventlogging/manifests/service/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 97
./modules/eventlogging/manifests/service/service.pp - WARNING: top-scope variable being used without an explicit namespace on line 103
./modules/gridengine/manifests/resourcedir.pp - WARNING: top-scope variable being used without an explicit namespace on line 15
./modules/gridengine/manifests/resourcedir.pp - WARNING: top-scope variable being used without an explicit namespace on line 19
./modules/gridengine/manifests/resourcedir.pp - WARNING: top-scope variable being used without an explicit namespace on line 20
./modules/lvs/manifests/configuration.pp - WARNING: top-scope variable being used without an explicit namespace on line 56
./modules/udp2log/manifests/instance/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 43
./modules/mysql/manifests/server/package.pp - WARNING: top-scope variable being used without an explicit namespace on line 20
./modules/role/manifests/postgres/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 22
./modules/role/manifests/postgres/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 34
./modules/role/manifests/postgres/slave.pp - WARNING: top-scope variable being used without an explicit namespace on line 12
./modules/role/manifests/ganglia/web.pp - WARNING: top-scope variable being used without an explicit namespace on line 20
./modules/role/manifests/cache/kafka/webrequest.pp - WARNING: top-scope variable being used without an explicit namespace on line 17
./modules/role/manifests/cache/kafka/eventlogging.pp - WARNING: top-scope variable being used without an explicit namespace on line 7
./modules/role/manifests/cache/kafka/statsv.pp - WARNING: top-scope variable being used without an explicit namespace on line 19
./modules/role/manifests/osm/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 54
./modules/role/manifests/osm/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 66
./modules/role/manifests/osm/slave.pp - WARNING: top-scope variable being used without an explicit namespace on line 16
./modules/puppetmaster/manifests/init.pp - WARNING: top-scope variable being used without an explicit namespace on line 87
./modules/puppetmaster/manifests/gitclone.pp - WARNING: top-scope variable being used without an explicit namespace on line 54
./modules/puppet/manifests/self/master.pp - WARNING: top-scope variable being used without an explicit namespace on line 52
./manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 285
./manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 291
./manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 297
./manifests/misc/monitoring.pp - WARNING: top-scope variable being used without an explicit namespace on line 303
./manifests/role/mariadb.pp - WARNING: top-scope variable being used without an explicit namespace on line 783

Change 273028 had a related patch set uploaded (by Ottomata):
Fix variable reference $standalone_master_host

https://gerrit.wikimedia.org/r/273028

Change 273028 merged by Ottomata:
Fix variable reference $standalone_master_host

https://gerrit.wikimedia.org/r/273028

Change 279269 had a related patch set uploaded (by Dzahn):
add FIXME's/ignores for all puppet 2.8 issues

https://gerrit.wikimedia.org/r/279269

Change 279269 merged by Dzahn:
add FIXME's/ignores for all variable scope issues

https://gerrit.wikimedia.org/r/279269

Change 279289 had a related patch set uploaded (by Dzahn):
puppet-lint: remove global exception for variable scope issues

https://gerrit.wikimedia.org/r/279289

Change 279289 merged by Dzahn:
puppet-lint: remove global exception for variable scope issues

https://gerrit.wikimedia.org/r/279289

Change 279297 had a related patch set uploaded (by Tim Landscheidt):
gridengine: Fix puppet-lint warning

https://gerrit.wikimedia.org/r/279297

Change 279297 merged by Dzahn:
gridengine: Fix puppet-lint warning

https://gerrit.wikimedia.org/r/279297

Andrew claimed this task.