Skip to content

Commit f9496c6

Browse files
authored
Merge pull request #9020 from mhashizume/PUP-11763/7.x/time-string
(PUP-11763) Converts ctime/mtime to string
2 parents d6d631a + 7b7a896 commit f9496c6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/puppet/type/file/ctime.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def retrieve
1010
if stat
1111
current_value = stat.ctime
1212
end
13-
current_value
13+
current_value.to_s
1414
end
1515

1616
validate do |val|

lib/puppet/type/file/mtime.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def retrieve
99
if stat
1010
current_value = stat.mtime
1111
end
12-
current_value
12+
current_value.to_s
1313
end
1414

1515
validate do |val|

spec/unit/type/file/ctime_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@resource[:audit] = [:ctime]
1616

1717
# this .to_resource audit behavior is magical :-(
18-
expect(@resource.to_resource[:ctime]).to eq(Puppet::FileSystem.stat(@filename).ctime)
18+
expect(@resource.to_resource[:ctime]).to eq(Puppet::FileSystem.stat(@filename).ctime.to_s)
1919
end
2020

2121
it "should return absent if auditing an absent file" do

spec/unit/type/file/mtime_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@resource[:audit] = [:mtime]
1616

1717
# this .to_resource audit behavior is magical :-(
18-
expect(@resource.to_resource[:mtime]).to eq(Puppet::FileSystem.stat(@filename).mtime)
18+
expect(@resource.to_resource[:mtime]).to eq(Puppet::FileSystem.stat(@filename).mtime.to_s)
1919
end
2020

2121
it "should return absent if auditing an absent file" do

0 commit comments

Comments
 (0)