foreman_remote_execution 5.0.7 → 5.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b594c8c925184933cb949bbd2bc4076e038169230ed026f011f1ab11c8a8c219
4
- data.tar.gz: 5e6399f060e13f3c36008532d71933596117c459b8630011e1f1cde9af0e5083
3
+ metadata.gz: 1a2e413a1866d81800d45a4e108897ffb2c219abbe3db4273f7276f44ae94267
4
+ data.tar.gz: da9d69d1268afa1e3a7acd289f3a8c4163364eb06d54eb0a1df780300a889e45
5
5
  SHA512:
6
- metadata.gz: d9ed4467afcf496da03fc1104e7bb718e4b3fb322425ce878ef563c1a50dbc979853c412117af7456ddeb369c38574669cbfee0e6425e0fcf0cfffd41ed1ce3e
7
- data.tar.gz: 0c625941d71763de35285b39c81ec216addf108a2c59e3f71e11c78a20b8668b0e77eb8d2fae5d941403e3c5c5e460a608369bcd455214be80f2da9fe7fe95b4
6
+ metadata.gz: 77af52b52f1e49a2f855cec4ad19209248df85915c9411630a842e4446dd0eb9c0f73acccf4d91a42730d32cf6bb6caed916a351e8ed8c6a8211c8836fc281b2
7
+ data.tar.gz: 917f3540ee35e95fb431ebc37e69e852ffd6fbbcd82e5ddbfb6b5ddfc504f85ce1950ab143e7f40d7c481f56a87b3a91887cb39bafd9bcfd8df73b7fe29c043b
@@ -217,7 +217,7 @@ class JobInvocationComposer
217
217
  def format_datetime(datetime)
218
218
  return datetime if datetime.blank?
219
219
 
220
- Time.parse(datetime).in_time_zone.strftime('%Y-%m-%d %H:%M')
220
+ Time.zone.parse(datetime).strftime('%Y-%m-%d %H:%M')
221
221
  end
222
222
  end
223
223
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '5.0.7'.freeze
2
+ VERSION = '5.0.8'.freeze
3
3
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_plugin_helper'
4
+
5
+ class ApiParamsTest < ActiveSupport::TestCase
6
+ describe '#format_datetime' do
7
+ let(:params) { JobInvocationComposer::ApiParams.allocate }
8
+
9
+ it 'leaves empty string as is' do
10
+ assert_equal params.send(:format_datetime, ''), ''
11
+ end
12
+
13
+ it 'honors explicitly supplied time zone' do
14
+ in_time_zone(ActiveSupport::TimeZone['America/New_York']) do
15
+ assert_equal '2022-07-08 08:53', params.send(:format_datetime, '2022-07-08 12:53:20 UTC')
16
+ end
17
+ end
18
+
19
+ it 'implicitly honors current user\'s time zone' do
20
+ in_time_zone(ActiveSupport::TimeZone['America/New_York']) do
21
+ assert_equal '2022-07-08 12:53', params.send(:format_datetime, '2022-07-08 12:53:20')
22
+ end
23
+ end
24
+ end
25
+
26
+ def in_time_zone(zone)
27
+ old_tz = Time.zone
28
+ Time.zone = zone
29
+ yield
30
+ ensure
31
+ Time.zone = old_tz
32
+ end
33
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.7
4
+ version: 5.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-12 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -388,6 +388,7 @@ files:
388
388
  - test/test_plugin_helper.rb
389
389
  - test/unit/actions/run_host_job_test.rb
390
390
  - test/unit/actions/run_hosts_job_test.rb
391
+ - test/unit/api_params_test.rb
391
392
  - test/unit/concerns/foreman_tasks_cleaner_extensions_test.rb
392
393
  - test/unit/concerns/host_extensions_test.rb
393
394
  - test/unit/concerns/nic_extensions_test.rb
@@ -545,7 +546,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
545
546
  - !ruby/object:Gem::Version
546
547
  version: '0'
547
548
  requirements: []
548
- rubygems_version: 3.1.4
549
+ rubygems_version: 3.2.26
549
550
  signing_key:
550
551
  specification_version: 4
551
552
  summary: A plugin bringing remote execution to the Foreman, completing the config
@@ -572,6 +573,7 @@ test_files:
572
573
  - test/test_plugin_helper.rb
573
574
  - test/unit/actions/run_host_job_test.rb
574
575
  - test/unit/actions/run_hosts_job_test.rb
576
+ - test/unit/api_params_test.rb
575
577
  - test/unit/concerns/foreman_tasks_cleaner_extensions_test.rb
576
578
  - test/unit/concerns/host_extensions_test.rb
577
579
  - test/unit/concerns/nic_extensions_test.rb