Skip to content
This repository was archived by the owner on Jan 23, 2019. It is now read-only.

Commit dcc0c17

Browse files
committed
Handle potentially missing attributes for (currently) un-supported platforms.
1 parent df0423d commit dcc0c17

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gem "license_finder", "~> 1.2.0"
99
gem "rake", "~> 10.4.0"
1010
gem "rubocop", "~> 0.29.1"
1111
gem "serverspec", "~> 2.8.0"
12+
gem "andand", "~> 1.3.3"
1213

1314
group :integration do
1415
gem "busser-serverspec", "~> 0.5.3"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ default["postgresql"]["cfg_update_action"] = :restart
243243
#----------------------------------------------------------------------------
244244
# APT REPOSITORY
245245
#----------------------------------------------------------------------------
246-
default["postgresql"]["apt_distribution"] = node["lsb"]["codename"]
246+
default["postgresql"]["apt_distribution"] = node["lsb"] && node["lsb"]["codename"]
247247
default["postgresql"]["apt_repository"] = "apt.postgresql.org"
248248
default["postgresql"]["apt_uri"] = "http://apt.postgresql.org/pub/repos/apt"
249249
default["postgresql"]["apt_components"] = ["main"]

attributes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# APT REPOSITORY
2121
#------------------------------------------------------------------------------
2222

23-
default["postgresql"]["apt_distribution"] = node["lsb"]["codename"]
23+
default["postgresql"]["apt_distribution"] = node["lsb"] && node["lsb"]["codename"]
2424
default["postgresql"]["apt_repository"] = "apt.postgresql.org"
2525
default["postgresql"]["apt_uri"] = "http://apt.postgresql.org/pub/repos/apt"
2626
default["postgresql"]["apt_components"] = ["main", node["postgresql"]["version"]]

recipes/debian_backports.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
#
55

66
# backports for initial support
7-
backports_uri = if node["lsb"]["codename"] == "wheezy"
7+
backports_uri = if node["lsb"] && node["lsb"]["codename"] == "wheezy"
88
"http://cdn.debian.net/debian"
99
else
1010
"http://backports.debian.org/debian-backports"
1111
end
1212

1313
apt_repository "debian-backports" do
1414
uri backports_uri
15-
distribution "#{node["lsb"]["codename"]}-backports"
15+
distribution "#{node["lsb"] && node["lsb"]["codename"]}-backports"
1616
components ["main"]
1717
end
1818

1919
# backports support for debian
2020
%w[libpq5 postgresql-common].each do |pkg|
2121
package pkg do
22-
options "-t #{node["lsb"]["codename"]}-backports"
22+
options "-t #{node["lsb"] && node["lsb"]["codename"]}-backports"
2323
end
2424
end

0 commit comments

Comments
 (0)