File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
lib/puppet/provider/sshkey
spec/unit/provider/sshkey Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,10 @@ def title
33
33
end
34
34
35
35
def self . default_target
36
- case Facter . value ( :operatingsystem )
36
+ case Facter . value ( 'os.name' )
37
37
when 'Darwin'
38
38
# Versions 10.11 and up use /etc/ssh/ssh_known_hosts
39
- version = Facter . value ( :macosx_productversion_major )
39
+ version = Facter . value ( 'os.macosx.version.major' )
40
40
if version
41
41
if Puppet ::Util ::Package . versioncmp ( version , '10.11' ) >= 0
42
42
'/etc/ssh/ssh_known_hosts'
Original file line number Diff line number Diff line change @@ -72,22 +72,22 @@ def key
72
72
context 'default ssh_known_hosts target path' do
73
73
[ '9.10' , '9.11' , '10.10' ] . each do |version |
74
74
it 'is `/etc/ssh_known_hosts` when OSX version 10.10 or older`' do
75
- expect ( Facter ) . to receive ( :value ) . with ( :operatingsystem ) . and_return ( 'Darwin' )
76
- expect ( Facter ) . to receive ( :value ) . with ( :macosx_productversion_major ) . and_return ( version )
75
+ expect ( Facter ) . to receive ( :value ) . with ( 'os.name' ) . and_return ( 'Darwin' )
76
+ expect ( Facter ) . to receive ( :value ) . with ( 'os.macosx.version.major' ) . and_return ( version )
77
77
expect ( subject . default_target ) . to eq ( '/etc/ssh_known_hosts' )
78
78
end
79
79
end
80
80
81
81
[ '10.11' , '10.13' , '11.0' , '11.11' ] . each do |version |
82
82
it 'is `/etc/ssh/ssh_known_hosts` when OSX version 10.11 or newer`' do
83
- expect ( Facter ) . to receive ( :value ) . with ( :operatingsystem ) . and_return ( 'Darwin' )
84
- expect ( Facter ) . to receive ( :value ) . with ( :macosx_productversion_major ) . and_return ( version )
83
+ expect ( Facter ) . to receive ( :value ) . with ( 'os.name' ) . and_return ( 'Darwin' )
84
+ expect ( Facter ) . to receive ( :value ) . with ( 'os.macosx.version.major' ) . and_return ( version )
85
85
expect ( subject . default_target ) . to eq ( '/etc/ssh/ssh_known_hosts' )
86
86
end
87
87
end
88
88
89
89
it 'is `/etc/ssh/ssh_known_hosts` on other operating systems' do
90
- expect ( Facter ) . to receive ( :value ) . with ( :operatingsystem ) . and_return ( 'RedHat' )
90
+ expect ( Facter ) . to receive ( :value ) . with ( 'os.name' ) . and_return ( 'RedHat' )
91
91
expect ( subject . default_target ) . to eq ( '/etc/ssh/ssh_known_hosts' )
92
92
end
93
93
end
You can’t perform that action at this time.
0 commit comments