Skip to content

Commit 1c70c9c

Browse files
committed
test(repository): use system.platform[:codename] [skip ci]
Tested: * https://gitlab.com/myii/postgres-formula/-/pipelines/470237956
1 parent 1270d0c commit 1c70c9c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

test/integration/repo/controls/repository.rb

+3-13
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,11 @@
1818
repo_file = os_name_repo_file[platform.name]
1919

2020
when 'debian'
21-
# Inspec does not provide a `codename` matcher, so we add ours
22-
finger_codename = {
23-
'ubuntu-18.04' => 'bionic',
24-
'ubuntu-20.04' => 'focal',
25-
'debian-9' => 'stretch',
26-
'debian-10' => 'buster',
27-
'debian-11' => 'bullseye'
28-
}
29-
codename = finger_codename[system.platform[:finger]]
30-
3121
repo_keyring = '/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg'
3222
repo_file = '/etc/apt/sources.list.d/pgdg.list'
33-
# rubocop:disable Metrics/LineLength
34-
repo_url = "deb [signed-by=#{repo_keyring}] http://apt.postgresql.org/pub/repos/apt #{codename}-pgdg main"
35-
# rubocop:enable Metrics/LineLength
23+
# rubocop:disable Layout/LineLength
24+
repo_url = "deb [signed-by=#{repo_keyring}] http://apt.postgresql.org/pub/repos/apt #{system.platform[:codename]}-pgdg main"
25+
# rubocop:enable Layout/LineLength
3626
end
3727

3828
control 'Postgresql repository keyring' do

0 commit comments

Comments
 (0)