hybrid_platforms_conductor 33.0.4 → 33.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bedd336d4e713f15ac516cd61d50cf964c2a25051fbb624e1ca75196ccd9dd39
4
- data.tar.gz: 2d75b29868194072733dd273f6d2f17ca001cc167f446105b72381e1620c57a1
3
+ metadata.gz: b6645a2b01eb498947d9d5e39803a664a18b263f5074d75b2f0191989df050c8
4
+ data.tar.gz: 4191d477ce05a66619be72968cbbc67d2e906e33f2a9cd797fb18ca3122712de
5
5
  SHA512:
6
- metadata.gz: f4333f83879592e3089ce6cf0e40609efab2435fe9bbecae699462871bab7c3df6b5e44da476b823dfde6f0f1868d1cbd5ca621a076ca147355950b1610b6e38
7
- data.tar.gz: e0f21e5ccec863d19c93fa1f36bcf51ce1be1a7b1e7bcdbcf83329914df3b3c852eb43b8af2e178b68f94305584c406007de0d47acc713f8170e7b7bba3da621
6
+ metadata.gz: 332a36210a05466e95172a3b2eececb081deea896fc19252286c1220fc18ceed70e29b29674127cb7ff51a094ff9358afc1c151f55d0d2135fa987a5d4534002
7
+ data.tar.gz: 2f7b69283769da47dd742f10b3546cf6625422c16fcdeed9882ade4c6f6a5eef2e1e795b10bc5dd2fa93a8d0bc6fcd0e33fab57fa5c4707f6a2a5afb1ee4df36
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [v33.1.0](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.0.4...v33.1.0) (2021-06-18 11:37:28)
2
+
3
+ ## Global changes
4
+ ### Patches
5
+
6
+ * [[Feature(connector_local)] [#68] Add sudo support when copying files using the local connector](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/7725beca4429de0e81bcac0c0ac4fe149e625da2)
7
+
8
+ ## Changes for connector_local
9
+ ### Features
10
+
11
+ * [[Feature(connector_local)] [#68] Add sudo support when copying files using the local connector](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/7725beca4429de0e81bcac0c0ac4fe149e625da2)
12
+
1
13
  # [v33.0.4](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.0.3...v33.0.4) (2021-06-18 10:09:57)
2
14
 
3
15
  ## Global changes
@@ -75,7 +75,11 @@ module HybridPlatformsConductor
75
75
  def remote_copy(from, to, sudo: false, owner: nil, group: nil)
76
76
  # If the destination is a relative path, prepend the workspace dir to it.
77
77
  to = "#{workspace_for(@node)}/#{to}" unless to.start_with?('/')
78
- FileUtils.cp_r from, to
78
+ if sudo
79
+ run_cmd "#{@nodes_handler.sudo_on(@node)} cp -r \"#{from}\" \"#{to}\""
80
+ else
81
+ FileUtils.cp_r from, to unless @cmd_runner.dry_run
82
+ end
79
83
  end
80
84
  # rubocop:enable Lint/UnusedMethodArgument
81
85
 
@@ -1,5 +1,5 @@
1
1
  module HybridPlatformsConductor
2
2
 
3
- VERSION = '33.0.4'
3
+ VERSION = '33.1.0'
4
4
 
5
5
  end
@@ -87,6 +87,43 @@ describe HybridPlatformsConductor::ActionsExecutor do
87
87
  end
88
88
  end
89
89
 
90
+ it 'does not copy files remotely in dry-run mode' do
91
+ with_test_platform_for_remote_testing do
92
+ test_cmd_runner.dry_run = true
93
+ expect(FileUtils).not_to receive(:cp_r)
94
+ test_connector.remote_copy('/path/to/src.file', '/remote_path/to/dst.dir')
95
+ end
96
+ end
97
+
98
+ it 'copies files remotely with sudo' do
99
+ with_test_platform_for_remote_testing(
100
+ expected_cmds: [
101
+ [
102
+ 'sudo -u root cp -r "/path/to/src.file" "/remote_path/to/dst.dir"',
103
+ proc { [0, '', ''] }
104
+ ]
105
+ ]
106
+ ) do
107
+ test_connector.remote_copy('/path/to/src.file', '/remote_path/to/dst.dir', sudo: true)
108
+ end
109
+ end
110
+
111
+ it 'copies files remotely with a different sudo' do
112
+ with_test_platform_for_remote_testing(
113
+ expected_cmds: [
114
+ [
115
+ 'other_sudo --user root cp -r "/path/to/src.file" "/remote_path/to/dst.dir"',
116
+ proc { [0, '', ''] }
117
+ ]
118
+ ],
119
+ additional_config: <<~'EO_CONFIG'
120
+ sudo_for { |user| "other_sudo --user #{user}" }
121
+ EO_CONFIG
122
+ ) do
123
+ test_connector.remote_copy('/path/to/src.file', '/remote_path/to/dst.dir', sudo: true)
124
+ end
125
+ end
126
+
90
127
  it 'copies files remotely with timeout' do
91
128
  with_test_platform_for_remote_testing(
92
129
  timeout: 5
@@ -103,6 +140,35 @@ describe HybridPlatformsConductor::ActionsExecutor do
103
140
  end
104
141
  end
105
142
 
143
+ it 'copies relative files remotely with sudo' do
144
+ with_test_platform_for_remote_testing(
145
+ expected_cmds: [
146
+ [
147
+ 'sudo -u root cp -r "/path/to/src.file" "/tmp/hpc_local_workspaces/node/to/dst.dir"',
148
+ proc { [0, '', ''] }
149
+ ]
150
+ ]
151
+ ) do
152
+ test_connector.remote_copy('/path/to/src.file', 'to/dst.dir', sudo: true)
153
+ end
154
+ end
155
+
156
+ it 'copies relative files remotely with a different sudo' do
157
+ with_test_platform_for_remote_testing(
158
+ expected_cmds: [
159
+ [
160
+ 'other_sudo --user root cp -r "/path/to/src.file" "/tmp/hpc_local_workspaces/node/to/dst.dir"',
161
+ proc { [0, '', ''] }
162
+ ]
163
+ ],
164
+ additional_config: <<~'EO_CONFIG'
165
+ sudo_for { |user| "other_sudo --user #{user}" }
166
+ EO_CONFIG
167
+ ) do
168
+ test_connector.remote_copy('/path/to/src.file', 'to/dst.dir', sudo: true)
169
+ end
170
+ end
171
+
106
172
  end
107
173
 
108
174
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hybrid_platforms_conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 33.0.4
4
+ version: 33.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan