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
3333 end
3434
3535 def self . default_target
36- case Facter . value ( :operatingsystem )
36+ case Facter . value ( 'os.name' )
3737 when 'Darwin'
3838 # 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' )
4040 if version
4141 if Puppet ::Util ::Package . versioncmp ( version , '10.11' ) >= 0
4242 '/etc/ssh/ssh_known_hosts'
Original file line number Diff line number Diff line change @@ -72,22 +72,22 @@ def key
7272 context 'default ssh_known_hosts target path' do
7373 [ '9.10' , '9.11' , '10.10' ] . each do |version |
7474 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 )
7777 expect ( subject . default_target ) . to eq ( '/etc/ssh_known_hosts' )
7878 end
7979 end
8080
8181 [ '10.11' , '10.13' , '11.0' , '11.11' ] . each do |version |
8282 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 )
8585 expect ( subject . default_target ) . to eq ( '/etc/ssh/ssh_known_hosts' )
8686 end
8787 end
8888
8989 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' )
9191 expect ( subject . default_target ) . to eq ( '/etc/ssh/ssh_known_hosts' )
9292 end
9393 end
You can’t perform that action at this time.
0 commit comments