opswalrus 1.0.102 → 1.0.103
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/opswalrus/host.rb +28 -16
- data/lib/opswalrus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcc7b4d3e59f51ac90c2025c27345d0f9da65095c6d4406cbb522d3eca800f74
|
4
|
+
data.tar.gz: 5ab46800dd863a1d58635eafdf83755497d60b505b4b35ac50a61c5022f8cf6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53ddd2218bc5a22a7144fdb04ee65c57acb79ab63c661815d2f170a2f64c37e40136f1efad9b115f3249b29b67d0f7242ebcd1f72a9f2275282b5fdee9543582
|
7
|
+
data.tar.gz: 39dca248da2b08cf0f96b1ca53d5fa56139dbec7747e7f4f6415f77cbe92674c995844a7a659eee69d9ae5d435b077458c2d22ff5cf07591ae4eda9c46cff3a8
|
data/Gemfile.lock
CHANGED
data/lib/opswalrus/host.rb
CHANGED
@@ -122,25 +122,12 @@ module OpsWalrus
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def _zip_copy_and_run_ops_bundle(local_host, block)
|
125
|
-
|
126
|
-
zip_bundle_path = @runtime_env.zip_bundle_path
|
127
|
-
upload_success = @_host.upload(zip_bundle_path, "tmpops.zip")
|
128
|
-
raise Error, "Unable to upload ops bundle to remote host" unless upload_success
|
129
|
-
|
130
|
-
stdout, _stderr, exit_status = @_host.run_ops(:bundle, "unzip tmpops.zip", in_bundle_root_dir: false)
|
131
|
-
raise Error, "Unable to unzip ops bundle on remote host: #{stdout}" unless exit_status == 0
|
132
|
-
tmp_bundle_root_dir = stdout.strip
|
133
|
-
@_host.set_ssh_session_tmp_bundle_root_dir(tmp_bundle_root_dir)
|
125
|
+
@_host._initialize_session(local_host)
|
134
126
|
|
135
|
-
# we run the block in the context of the host proxy object, s.t. `self` within the block evaluates to the host proxy object
|
127
|
+
# we run the block in the context of the host proxy object, s.t. `self` within the block evaluates to the host proxy object (i.e. self)
|
136
128
|
retval = instance_exec(local_host, &block) # local_host is passed as the argument to the block
|
137
129
|
|
138
|
-
|
139
|
-
if tmp_bundle_root_dir =~ /tmp/ # sanity check the temp path before we blow away something we don't intend
|
140
|
-
@_host.execute(:rm, "-rf", "tmpops.zip", tmp_bundle_root_dir)
|
141
|
-
else
|
142
|
-
@_host.execute(:rm, "-rf", "tmpops.zip")
|
143
|
-
end
|
130
|
+
@_host._cleanup_session
|
144
131
|
|
145
132
|
retval
|
146
133
|
end
|
@@ -217,6 +204,9 @@ module OpsWalrus
|
|
217
204
|
|
218
205
|
if reconnected
|
219
206
|
initial_reconnect_delay + (Time.now - t1)
|
207
|
+
|
208
|
+
# initialize session again
|
209
|
+
@_host._initialize_session(local_host)
|
220
210
|
end
|
221
211
|
end
|
222
212
|
|
@@ -574,6 +564,28 @@ module OpsWalrus
|
|
574
564
|
@tmp_bundle_root_dir = tmp_bundle_root_dir
|
575
565
|
end
|
576
566
|
|
567
|
+
# returns the temporary bundle root directory
|
568
|
+
def _initialize_session
|
569
|
+
# copy over ops bundle zip file
|
570
|
+
zip_bundle_path = @runtime_env.zip_bundle_path
|
571
|
+
upload_success = @_host.upload(zip_bundle_path, "tmpops.zip")
|
572
|
+
raise Error, "Unable to upload ops bundle to remote host" unless upload_success
|
573
|
+
|
574
|
+
stdout, _stderr, exit_status = @_host.run_ops(:bundle, "unzip tmpops.zip", in_bundle_root_dir: false)
|
575
|
+
raise Error, "Unable to unzip ops bundle on remote host: #{stdout}" unless exit_status == 0
|
576
|
+
tmp_bundle_root_dir = stdout.strip
|
577
|
+
set_ssh_session_tmp_bundle_root_dir(tmp_bundle_root_dir)
|
578
|
+
end
|
579
|
+
|
580
|
+
def _cleanup_session
|
581
|
+
# todo: cleanup
|
582
|
+
if @tmp_bundle_root_dir =~ /tmp/ # sanity check the temp path before we blow away something we don't intend
|
583
|
+
@_host.execute(:rm, "-rf", "tmpops.zip", @tmp_bundle_root_dir)
|
584
|
+
else
|
585
|
+
@_host.execute(:rm, "-rf", "tmpops.zip")
|
586
|
+
end
|
587
|
+
end
|
588
|
+
|
577
589
|
def clear_ssh_session
|
578
590
|
@runtime_env = nil
|
579
591
|
@ops_file_script = nil
|
data/lib/opswalrus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opswalrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.103
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Ellis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|