uricp 0.0.29 → 0.0.30

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: 9e24fdb3944db682f49ca90b6eb4639885389d689610e76cbcbf5d83e5619208
4
- data.tar.gz: 99eeabde06d5f28aa9c33b1faa9306bf9fb65cba504c68359968388515061d8b
3
+ metadata.gz: a10697c8ebadc4cb158670335272b8b4b4681aac70182c95a6dd2b842587d61a
4
+ data.tar.gz: a07ca44d72030583442c8e572754aa164498fc8dce625dfde001e107a02b3533
5
5
  SHA512:
6
- metadata.gz: ef6450ea82fe52174ec0037e4e62711c35da6c2c746ecab02d123ec00df35f5bf3697f3b55b595c509274b9446e7a7446f2167401793d17a1f6c00c88cba6186
7
- data.tar.gz: 7b9d798e540f9f3e4418e7c7facd08120c1c889320baf8b7d707464aafdd89ad2f492ec7c0233e4537e05027ff6de7eb25fe79444ce753a11600c610cb9a9682
6
+ metadata.gz: 35a87e4afe346283df0838e50c8a57b28893e7841582917ef11ee0eee76b20a0f52941616e78cef35c3b7d8d0ab2db5978d5c4cd338054e36bafabee50d12a82
7
+ data.tar.gz: fd3c6fda3b1624519abd26dd6bc8a54bda4d615ec098d1fb37cf279ab12640c643323b499f25e1fc811d9a2400fea59c55c4a2f1bcbe8c9ba90c629b73fb1775
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uricp (0.0.29)
4
+ uricp (0.0.30)
5
5
  childprocess (~> 1.0)
6
6
  filesize (= 0.0.2)
7
7
  methadone (~> 2.0.2)
@@ -3,11 +3,11 @@ MAINTAINER support@brightbox.co.uk
3
3
 
4
4
  RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
5
5
  RUN dnf -y install dnf-plugins-core
6
- RUN dnf config-manager --add-repo https://repo.almalinux.org/almalinux/8.4/devel/almalinux-devel.repo
6
+ RUN dnf config-manager --add-repo https://repo.almalinux.org/almalinux/8/devel/almalinux-devel.repo
7
+ RUN echo "8-stream" > /etc/dnf/vars/stream
7
8
  RUN dnf -y update
8
9
  RUN dnf config-manager --set-enabled powertools,devel
9
10
  RUN dnf -y group install "Development Tools"
10
- RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
11
11
  RUN dnf -y install https://www.rdoproject.org/repos/rdo-release.el8.rpm
12
12
  RUN dnf -y install \
13
13
  git \
@@ -246,3 +246,55 @@ Feature: Manipulate file images in ceph
246
246
  """
247
247
  rbd snap protect --id libvirt 'servers/img-testy@base'
248
248
  """
249
+
250
+ Scenario: RBD export and upload to HTTPS
251
+ Given a correctly initialised cache at "/tmp/uricp"
252
+ When I successfully run `uricp --dry-run --auth-token 'd75945e3b9159f1f14e91b2022bc53ea10481ed15e4a' --target-format 'raw' --compress --segment-size '1073741824B' --cache '/var/cache/domtrix' rbd:/servers/vol-yd63x https://orbit.gb1s.brightbox.com/v1/acc-8tgbq/images/img-cfwe0`
253
+ And the output should contain:
254
+ """
255
+ rbd snap create --id libvirt 'servers/vol-yd63x@uricp_snap'
256
+ """
257
+ And the output should contain:
258
+ """
259
+ rbd snap protect --id libvirt 'servers/vol-yd63x@uricp_snap'
260
+ """
261
+ And the output should not contain:
262
+ """
263
+ rbd snap unprotect --id libvirt 'servers/vol-yd63x@uricp_snap'
264
+ """
265
+ And the output should not contain:
266
+ """
267
+ rbd snap rm --id libvirt 'servers/vol-yd63x@uricp_snap'
268
+ """
269
+ And the output should not contain:
270
+ """
271
+ rbd export --no-progress --id libvirt 'servers/vol-yd63x@uricp_snap' -
272
+ """
273
+ And the output should contain:
274
+ """
275
+ rbd clone --id libvirt 'servers/vol-yd63x@uricp_snap' 'servers/img-cfwe0'
276
+ """
277
+ And the output should contain:
278
+ """
279
+ rbd export --no-progress --id libvirt 'servers/img-cfwe0@base' -
280
+ """
281
+ And the output should contain:
282
+ """
283
+ rbd snap create --id libvirt 'servers/img-cfwe0@base'
284
+ """
285
+ And the output should contain:
286
+ """
287
+ rbd snap protect --id libvirt 'servers/img-cfwe0@base'
288
+ """
289
+ And the output should contain:
290
+ """
291
+ rbd export --no-progress --id libvirt 'servers/img-cfwe0@base' -
292
+ """
293
+ And the output should contain:
294
+ """
295
+ lz4
296
+ """
297
+ And the output should contain:
298
+ """
299
+ segment_upload --segment-size '1073741824.00 B' https://orbit.gb1s.brightbox.com/v1/acc-8tgbq/images/img-cfwe0
300
+ """
@@ -6,6 +6,8 @@ module Uricp::Strategy
6
6
  include Uricp::CurlPrimitives
7
7
  include Methadone::SH
8
8
 
9
+ VOL_REGEX = /^(srv|vol)-.....$/
10
+
9
11
  def initialize(options)
10
12
  @options = options
11
13
  debug "#{self.class.name}: options are #{options.inspect}"
@@ -168,7 +170,7 @@ module Uricp::Strategy
168
170
  def rbd_cache_image_exists?(target)
169
171
  command = "rbd status --id #{rbd_id} --format json #{target} 2>/dev/null"
170
172
  if dry_run?
171
- if options['dry-cache'] == :partial_rbd && options['cache_name'] !~ /srv-...../
173
+ if options['dry-cache'] == :partial_rbd && options['cache_name'] !~ VOL_REGEX
172
174
  command = 'exit 0'
173
175
  else
174
176
  command = 'exit 2'
@@ -193,7 +195,7 @@ module Uricp::Strategy
193
195
  def in_rbd_cache(target)
194
196
  result =
195
197
  if dry_run?
196
- options['dry-cache'] == :rbd && options['cache_name'] !~ /srv-...../
198
+ options['dry-cache'] == :rbd && options['cache_name'] !~ VOL_REGEX
197
199
  else
198
200
  snap_check(target, rbd_base_name)
199
201
  end
@@ -10,8 +10,10 @@ module Uricp::Strategy
10
10
  without_active_cache do
11
11
  if from.scheme == 'rbd' &&
12
12
  rbd_snapshot_spec?(from) &&
13
- to.scheme != 'rbd'
14
- return proposal unless sequence_complete?
13
+ to.scheme != 'rbd' &&
14
+ (!conversion_required? || raw_target?) &&
15
+ !sequence_complete?
16
+ return proposal
15
17
  end
16
18
  end
17
19
  debug "#{self.class.name}: not appropriate"
@@ -25,6 +27,7 @@ module Uricp::Strategy
25
27
  def proposal
26
28
  @proposed_options = options.dup
27
29
  @proposed_options['from_uri'] = PIPE_URI
30
+ @proposed_options.delete('target-format')
28
31
  self
29
32
  end
30
33
  end
data/lib/uricp/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uricp
4
- VERSION = '0.0.29'
4
+ VERSION = '0.0.30'
5
5
  DEFAULT_SEGMENT_SIZE = '5 GiB'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uricp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-11 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba