Skip to content

Commit 81e61de

Browse files
committed
(PUP-4242) change deprecation warning for file namespace mismatch to an error
1 parent ddf8b76 commit 81e61de

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

lib/puppet/pops/validation/validator_factory_4_0.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def severity_producer
3636
p[Issues::NAME_WITH_HYPHEN] = :error
3737
p[Issues::EMPTY_RESOURCE_SPECIALIZATION] = :ignore
3838
p[Issues::CLASS_NOT_VIRTUALIZABLE] = Puppet[:strict] == :off ? :warning : Puppet[:strict]
39-
p[Issues::ILLEGAL_DEFINITION_LOCATION] = :deprecation
4039
p
4140
end
4241
end

spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/manifests/init.pp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
function puppet_init_calling_puppet() {
1+
function user::puppet_init_calling_puppet() {
22
usee::usee_puppet()
33
}
44

5-
function puppet_init_calling_puppet_init() {
5+
function user::puppet_init_calling_puppet_init() {
66
usee_puppet_init()
77
}
88

9-
function puppet_init_calling_ruby() {
9+
function user::puppet_init_calling_ruby() {
1010
usee::usee_ruby()
1111
}
1212

@@ -53,18 +53,18 @@ function puppet_init_calling_ruby() {
5353
7: {
5454
# Call a puppet function that resides in usee/functions from a puppet function in init.pp
5555
#
56-
notify { 'case_7': message => puppet_init_calling_puppet() }
56+
notify { 'case_7': message => user::puppet_init_calling_puppet() }
5757
}
5858
8: {
5959
# Call a puppet function that resides in usee/manifests/init.pp from a puppet function in init.pp
6060
#
6161
include usee
62-
notify { 'case_8': message => puppet_init_calling_puppet_init() }
62+
notify { 'case_8': message => user::puppet_init_calling_puppet_init() }
6363
}
6464
9: {
6565
# Call a ruby function that resides in usee from a puppet function in init.pp
6666
#
67-
notify { 'case_9': message => puppet_init_calling_ruby() }
67+
notify { 'case_9': message => user::puppet_init_calling_ruby() }
6868
}
6969
10: {
7070
# Call a puppet function that resides in usee/functions from a ruby function in this module

spec/unit/pops/validator/validator_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ def with_environment(environment, env_params = {})
136136
expect(acceptor).to have_issue(Puppet::Pops::Issues::DUPLICATE_KEY)
137137
end
138138

139-
it 'produces a deprecation for illegal function locations' do
139+
it 'produces an error for illegal function locations' do
140140
with_environment(environment) do
141141
acceptor = validate(parse('function aaa::ccc() {}', 'path/aaa/manifests/bbb.pp'))
142-
expect(deprecation_count(acceptor)).to eql(1)
143-
expect(acceptor.warning_count).to eql(1)
144-
expect(acceptor.error_count).to eql(0)
142+
expect(deprecation_count(acceptor)).to eql(0)
143+
expect(acceptor.warning_count).to eql(0)
144+
expect(acceptor.error_count).to eql(1)
145145
expect(acceptor).to have_issue(Puppet::Pops::Issues::ILLEGAL_DEFINITION_LOCATION)
146146
end
147147
end
@@ -170,12 +170,12 @@ def with_environment(environment, env_params = {})
170170
expect(acceptor).to have_issue(Puppet::Pops::Issues::CLASS_NOT_VIRTUALIZABLE)
171171
end
172172

173-
it 'produces a deprecation for illegal function locations' do
173+
it 'produces an error for illegal function locations' do
174174
with_environment(environment) do
175175
acceptor = validate(parse('function aaa::ccc() {}', 'path/aaa/manifests/bbb.pp'))
176-
expect(deprecation_count(acceptor)).to eql(1)
177-
expect(acceptor.warning_count).to eql(1)
178-
expect(acceptor.error_count).to eql(0)
176+
expect(deprecation_count(acceptor)).to eql(0)
177+
expect(acceptor.warning_count).to eql(0)
178+
expect(acceptor.error_count).to eql(1)
179179
expect(acceptor).to have_issue(Puppet::Pops::Issues::ILLEGAL_DEFINITION_LOCATION)
180180
end
181181
end
@@ -211,12 +211,12 @@ def with_environment(environment, env_params = {})
211211
expect(acceptor).to have_issue(Puppet::Pops::Issues::CLASS_NOT_VIRTUALIZABLE)
212212
end
213213

214-
it 'produces a deprecation for illegal function locations' do
214+
it 'produces an error for illegal function locations' do
215215
with_environment(environment) do
216216
acceptor = validate(parse('function aaa::ccc() {}', 'path/aaa/manifests/bbb.pp'))
217-
expect(deprecation_count(acceptor)).to eql(1)
218-
expect(acceptor.warning_count).to eql(1)
219-
expect(acceptor.error_count).to eql(0)
217+
expect(deprecation_count(acceptor)).to eql(0)
218+
expect(acceptor.warning_count).to eql(0)
219+
expect(acceptor.error_count).to eql(1)
220220
expect(acceptor).to have_issue(Puppet::Pops::Issues::ILLEGAL_DEFINITION_LOCATION)
221221
end
222222
end
@@ -231,12 +231,12 @@ def with_environment(environment, env_params = {})
231231
expect(acceptor).to_not have_issue(Puppet::Pops::Issues::DUPLICATE_KEY)
232232
end
233233

234-
it 'produces a deprecation for illegal function locations' do
234+
it 'produces an error for illegal function locations' do
235235
with_environment(environment) do
236236
acceptor = validate(parse('function aaa::ccc() {}', 'path/aaa/manifests/bbb.pp'))
237-
expect(deprecation_count(acceptor)).to eql(1)
238-
expect(acceptor.warning_count).to eql(1)
239-
expect(acceptor.error_count).to eql(0)
237+
expect(deprecation_count(acceptor)).to eql(0)
238+
expect(acceptor.warning_count).to eql(0)
239+
expect(acceptor.error_count).to eql(1)
240240
expect(acceptor).to have_issue(Puppet::Pops::Issues::ILLEGAL_DEFINITION_LOCATION)
241241
end
242242
end

0 commit comments

Comments
 (0)