Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix CI failures related to legacy facts
  • Loading branch information
smortex committed Oct 8, 2023
commit 0f9ab7e92152520ad8e733e2f0c0fdb5f7940f59
8 changes: 5 additions & 3 deletions spec/unit/classes/database/ssl_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
release: { 'full' => '7.0', 'major' => '7' },
selinux: { 'enabled' => true },
},
fqdn: 'cheery-rime@puppet',
networking: {
fqdn: 'cheery-rime@puppet',
},
}
end

Expand Down Expand Up @@ -125,7 +127,7 @@
it 'has ident rule' do
is_expected.to contain_postgresql__server__pg_ident_rule("Map the SSL certificate of the server as a #{params[:database_username]} user")
.with_map_name(identity_map)
.with_system_username(facts[:fqdn])
.with_system_username(facts[:networking][:fqdn])
.with_database_username(params[:database_name])
end

Expand Down Expand Up @@ -184,7 +186,7 @@
it 'has read ident rule' do
is_expected.to contain_postgresql__server__pg_ident_rule("Map the SSL certificate of the server as a #{params[:read_database_username]} user")
.with_map_name(read_identity_map)
.with_system_username(facts[:fqdn])
.with_system_username(facts[:networking][:fqdn])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't that be:

Suggested change
.with_system_username(facts[:networking][:fqdn])
.with_system_username(facts[:networking]['fqdn'])

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm… it seems to be worse. That being said at the beginning of the file we have:

      let(:facts) do
        {
          # ...
          networking: {
            fqdn: 'cheery-rime@puppet',
          },
          # ...
        }
      end

This module is hell… 😱

.with_database_username(params[:read_database_username])
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/classes/master/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
context "on #{os}" do
let(:facts) do
facts.merge(puppetversion: Puppet.version,
fqdn: 'puppetdb.example.com',
networking: { fqdn: 'puppetdb.example.com' },
selinux: true)
end

Expand Down
4 changes: 3 additions & 1 deletion spec/unit/classes/server/command_processing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'OpenBSD',
os: {
family: 'OpenBSD',
},
puppetversion: Puppet.version,
}
end
Expand Down
9 changes: 6 additions & 3 deletions spec/unit/classes/server/database_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
os: {
family: 'RedHat',
},
puppetversion: Puppet.version,
operatingsystemrelease: '7.0',
fqdn: 'test.domain.local',
networking: {
fqdn: 'test.domain.local',
},
}
end

Expand Down
9 changes: 6 additions & 3 deletions spec/unit/classes/server/db_connection_uri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
os: {
family: 'RedHat',
},
operatingsystemrelease: '7.0',
fqdn: 'test.domain.local',
networking: {
fqdn: 'test.domain.local',
},
}
end

Expand Down
9 changes: 6 additions & 3 deletions spec/unit/classes/server/db_read_uri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
os: {
family: 'RedHat',
},
operatingsystemrelease: '7.0',
fqdn: 'test.domain.local',
networking: {
fqdn: 'test.domain.local',
},
}
end

Expand Down
8 changes: 6 additions & 2 deletions spec/unit/classes/server/global_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
fqdn: 'foo.com',
os: {
family: 'RedHat',
},
networking: {
fqdn: 'foo.com',
},
}
end

Expand Down
8 changes: 6 additions & 2 deletions spec/unit/classes/server/jetty_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
fqdn: 'test.domain.local',
os: {
family: 'RedHat',
},
networking: {
fqdn: 'test.domain.local',
},
}
end

Expand Down
8 changes: 6 additions & 2 deletions spec/unit/classes/server/puppetdb_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
fqdn: 'test.domain.local',
os: {
family: 'RedHat',
},
networking: {
fqdn: 'test.domain.local',
},
}
end

Expand Down
9 changes: 6 additions & 3 deletions spec/unit/classes/server/read_database_ini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
context 'on a supported platform' do
let(:facts) do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
os: {
family: 'RedHat',
},
puppetversion: Puppet.version,
operatingsystemrelease: '7.0',
fqdn: 'test.domain.local',
networking: {
fqdn: 'test.domain.local',
},
}
end

Expand Down