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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cca021b1f893590122d04d39fe29b0a3543438df33e16b1061b7a8db9ac3ddc7
4
- data.tar.gz: f5de23d139bd4bb8533159760e62ef3e7e25153c47e45c610ef8a2df219b43a7
3
+ metadata.gz: dcc7b4d3e59f51ac90c2025c27345d0f9da65095c6d4406cbb522d3eca800f74
4
+ data.tar.gz: 5ab46800dd863a1d58635eafdf83755497d60b505b4b35ac50a61c5022f8cf6b
5
5
  SHA512:
6
- metadata.gz: 0bd03838bb556158b41f0c237719ee427ea6d0de3f46afb7370e66dd1f8f8ed04a5111fa6c9be8ad8242e2a1076d5e64a019f31a9c633c9b8123ea780ccaf737
7
- data.tar.gz: 227b14b284ba96f3697570c335c5b53d724a1f751fa4f55727d9905da46d32da605e483f8789bfca2b7ac303f67f0179a2664a8307747687f47f4b7f6e351052
6
+ metadata.gz: 53ddd2218bc5a22a7144fdb04ee65c57acb79ab63c661815d2f170a2f64c37e40136f1efad9b115f3249b29b67d0f7242ebcd1f72a9f2275282b5fdee9543582
7
+ data.tar.gz: 39dca248da2b08cf0f96b1ca53d5fa56139dbec7747e7f4f6415f77cbe92674c995844a7a659eee69d9ae5d435b077458c2d22ff5cf07591ae4eda9c46cff3a8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.102)
4
+ opswalrus (1.0.103)
5
5
  activesupport (~> 7.0)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  binding_of_caller (~> 1.0)
@@ -122,25 +122,12 @@ module OpsWalrus
122
122
  end
123
123
 
124
124
  def _zip_copy_and_run_ops_bundle(local_host, block)
125
- # copy over ops bundle zip file
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
- # todo: cleanup
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
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.102"
2
+ VERSION = "1.0.103"
3
3
  end
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.102
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-22 00:00:00.000000000 Z
11
+ date: 2024-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport