opswalrus 1.0.102 → 1.0.104

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: cca021b1f893590122d04d39fe29b0a3543438df33e16b1061b7a8db9ac3ddc7
4
- data.tar.gz: f5de23d139bd4bb8533159760e62ef3e7e25153c47e45c610ef8a2df219b43a7
3
+ metadata.gz: 47e66938c344825f2baa189ad1cbe961891263d08e47d55f7dca2e58641d2ac2
4
+ data.tar.gz: 8c0c990d36a341c88703a3de6febb9365e4127e14f8ff83775124169d6c488bd
5
5
  SHA512:
6
- metadata.gz: 0bd03838bb556158b41f0c237719ee427ea6d0de3f46afb7370e66dd1f8f8ed04a5111fa6c9be8ad8242e2a1076d5e64a019f31a9c633c9b8123ea780ccaf737
7
- data.tar.gz: 227b14b284ba96f3697570c335c5b53d724a1f751fa4f55727d9905da46d32da605e483f8789bfca2b7ac303f67f0179a2664a8307747687f47f4b7f6e351052
6
+ metadata.gz: c3abab16446029a28b84e3fd15edfd2b601abcb74fbe7da7229b10bcb27870fb32048d67b63693424d4e597075d1388b617cd6567fa44c3d4d10a5ce1ee00cf7
7
+ data.tar.gz: 409aa7af8116157ebbd6719d3efc51bcd68cccdc95c739ec853e6f7b259d237fd9822c9ffd0b394f811d62afb1153bc3481fcec333ee4117eca270c6f9108251
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.104)
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
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.104"
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.104
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