File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1313 text_line :environment , match : %r{^\s *\w +\s *=}
1414
1515 def self . filetype
16- tabname = case Facter . value ( :osfamily )
16+ tabname = case Facter . value ( 'os.family' )
1717 when 'Solaris'
1818 :suntab
1919 when 'AIX'
@@ -261,7 +261,7 @@ def user
261261 @property_hash [ :user ] || @property_hash [ :target ]
262262 end
263263
264- CRONTAB_DIR = case Facter . value ( 'osfamily ' )
264+ CRONTAB_DIR = case Facter . value ( 'os.family ' )
265265 when 'Debian' , 'HP-UX' , 'Solaris'
266266 '/var/spool/cron/crontabs'
267267 when %r{BSD}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def read
6767 # Remove a specific @path's cron tab.
6868 def remove
6969 cmd = "#{ cmdbase } -r"
70- if [ 'Darwin' , 'FreeBSD' , 'DragonFly' ] . include? ( Facter . value ( 'operatingsystem ' ) )
70+ if [ 'Darwin' , 'FreeBSD' , 'DragonFly' ] . include? ( Facter . value ( 'os.name ' ) )
7171 cmd = "/bin/echo yes | #{ cmd } "
7272 end
7373
@@ -96,7 +96,7 @@ def write(text)
9696 # Only add the -u flag when the @path is different. Fedora apparently
9797 # does not think I should be allowed to set the @path to my own user name
9898 def cmdbase
99- return 'crontab' if @uid == Puppet ::Util ::SUIDManager . uid || Facter . value ( :operatingsystem ) == 'HP-UX'
99+ return 'crontab' if @uid == Puppet ::Util ::SUIDManager . uid || Facter . value ( 'os.name' ) == 'HP-UX'
100100
101101 "crontab -u #{ @path } "
102102 end
Original file line number Diff line number Diff line change 6363
6464 describe 'when determining the correct filetype' do
6565 it 'uses the suntab filetype on Solaris' do
66- allow ( Facter ) . to receive ( :value ) . with ( :osfamily ) . and_return 'Solaris'
66+ allow ( Facter ) . to receive ( :value ) . with ( 'os.family' ) . and_return 'Solaris'
6767 expect ( described_class . filetype ) . to eq ( Puppet ::Provider ::Cron ::FileType ::FileTypeSuntab )
6868 end
6969
7070 it 'uses the aixtab filetype on AIX' do
71- allow ( Facter ) . to receive ( :value ) . with ( :osfamily ) . and_return 'AIX'
71+ allow ( Facter ) . to receive ( :value ) . with ( 'os.family' ) . and_return 'AIX'
7272 expect ( described_class . filetype ) . to eq ( Puppet ::Provider ::Cron ::FileType ::FileTypeAixtab )
7373 end
7474
7575 it 'uses the crontab filetype on other platforms' do
76- allow ( Facter ) . to receive ( :value ) . with ( :osfamily ) . and_return 'Not a real operating system family'
76+ allow ( Facter ) . to receive ( :value ) . with ( 'os.family' ) . and_return 'Not a real operating system family'
7777 expect ( described_class . filetype ) . to eq ( Puppet ::Provider ::Cron ::FileType ::FileTypeCrontab )
7878 end
7979 end
187187
188188 describe 'on linux' do
189189 before ( :each ) do
190- allow ( Facter ) . to receive ( :value ) . with ( :osfamily ) . and_return 'Linux'
191- allow ( Facter ) . to receive ( :value ) . with ( :operatingsystem )
190+ allow ( Facter ) . to receive ( :value ) . with ( 'os.family' ) . and_return 'Linux'
191+ allow ( Facter ) . to receive ( :value ) . with ( 'os.name' )
192192 end
193193
194194 it 'contains no resources for a user who has no crontab' do
You can’t perform that action at this time.
0 commit comments