foreman_snapshot_management 1.5.0 → 1.5.1

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: 398453ebe0f63f659d1431bc72ffb86f7f911d2d34798ee705e31ecb6d9a6258
4
- data.tar.gz: 1b87ef1a4f9b1ee6801a6e92374bafdbbe5e186bbe7631c0eb77a0eefec00863
3
+ metadata.gz: d57bbba1e33d99aefa82a4af43d69810abd02fee0bd56a971083a6d83950bf5f
4
+ data.tar.gz: f79a6a83310c1b0ee3f05ea2204cded44d690df624773ad642e88a9a323f372a
5
5
  SHA512:
6
- metadata.gz: 99977335ef42eec7289476e3571206d3542551d22731e2e72dff9027d6aff81aaffb665e692a83cd3674ae422670322b90577531202772e29f305af8914e2c8a
7
- data.tar.gz: fb935d293dd020528086ec7b55d6226ee8a401b08d0dd94ee73268a00e032200fc48e94f074d13cfed38baed97f516137320beeb20135d4b66d097026d666809
6
+ metadata.gz: 40e538d6c79a89036baa265408dbeecd99ce7fcb2c4cb9693e1bc92111001f592e8ea13d003028160b366ce2332702e0c51fedb2c07ec2a6ecbaab99622d5d91
7
+ data.tar.gz: a1c2345211c2d5eb3a2a6d63c74ca952d74351e014ad0f3b1957afcf6a5ba8dc3d3b9ddac69bd52344eeee235676f732f654d7bebfb46d9b69a655b0c904297f
data/README.md CHANGED
@@ -20,6 +20,8 @@ See [How_to_Install_a_Plugin](http://projects.theforeman.org/projects/foreman/wi
20
20
 
21
21
  | Foreman Version | Plugin Version |
22
22
  | --------------- | -------------- |
23
+ | 1.19 | >= 1.5.0 |
24
+ | 1.18 | >= 1.5.0 |
23
25
  | 1.17 | >= 1.5.0 |
24
26
 
25
27
  ## Contributing
@@ -8,7 +8,7 @@ module Api
8
8
  before_action :check_snapshot_capability
9
9
  before_action :find_resource, :only => %w[show update destroy revert]
10
10
 
11
- api :GET, 'hosts/:host_id/snapshots/', N_('List all snapshots')
11
+ api :GET, '/hosts/:host_id/snapshots', N_('List all snapshots')
12
12
  param :host_id, :identifier_dottable, :required => true
13
13
  def index
14
14
  @snapshots = resource_scope_for_index
@@ -27,17 +27,17 @@ module Api
27
27
  end
28
28
  end
29
29
 
30
- api :POST, '/hosts/:host_id/snapshots/', N_('Create a snapshot')
30
+ api :POST, '/hosts/:host_id/snapshots', N_('Create a snapshot')
31
31
  param :host_id, :identifier_dottable, :required => true
32
32
  param :include_ram, :bool, :default_value => false, :desc => N_('Whether to include the RAM state in the snapshot')
33
33
  param_group :snapshot, :as => :create
34
34
 
35
35
  def create
36
36
  @snapshot = resource_class.new(snapshot_params.to_h.merge(host: @nested_obj).merge(include_ram: params[:include_ram]))
37
- process_response @snapshot.save
37
+ process_response @snapshot.create
38
38
  end
39
39
 
40
- api :PUT, '/hosts/:host_id/snapshots/:id/', N_('Update a snapshot')
40
+ api :PUT, '/hosts/:host_id/snapshots/:id', N_('Update a snapshot')
41
41
  param :host_id, :identifier_dottable, :required => true
42
42
  param :id, :identifier_dottable, :required => true
43
43
  param_group :snapshot
@@ -159,6 +159,7 @@ module ForemanSnapshotManagement
159
159
 
160
160
  def handle_snapshot_errors
161
161
  yield
162
+ true
162
163
  rescue Foreman::WrappedException => e
163
164
  errors.add(:base, e.wrapped_exception.message)
164
165
  false
data/config/routes.rb CHANGED
@@ -8,7 +8,9 @@ Rails.application.routes.draw do
8
8
  resources :hosts, :only => [] do
9
9
  constraints(:id => /[^\/]+/) do
10
10
  resources :snapshots, except: [:new, :edit] do
11
- put :revert, :on => :collection
11
+ member do
12
+ put :revert
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanSnapshotManagement
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.5.1'.freeze
3
3
  end
@@ -1,8 +1,10 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class Api::V2::SnapshotsControllerTest < ActionController::TestCase
4
+ let(:tax_location) { Location.find_by_name('Location 1') }
5
+ let(:tax_organization) { Organization.find_by_name('Organization 1') }
4
6
  let(:compute_resource) do
5
- cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions')
7
+ cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions', :locations => [tax_location], organizations: [tax_organization])
6
8
  ComputeResource.find_by_id(cr.id)
7
9
  end
8
10
  let(:uuid) { '5032c8a5-9c5e-ba7a-3804-832a03e16381' }
@@ -2,8 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module ForemanSnapshotManagement
4
4
  class SnapshotsControllerTest < ActionController::TestCase
5
+ let(:tax_location) { Location.find_by_name('Location 1') }
6
+ let(:tax_organization) { Organization.find_by_name('Organization 1') }
5
7
  let(:compute_resource) do
6
- cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions')
8
+ cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions', :locations => [tax_location], organizations: [tax_organization])
7
9
  ComputeResource.find_by_id(cr.id)
8
10
  end
9
11
  let(:uuid) { '5032c8a5-9c5e-ba7a-3804-832a03e16381' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_snapshot_management
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -96,7 +96,7 @@ files:
96
96
  - test/controllers/api/v2/snapshots_test.rb
97
97
  - test/controllers/foreman_snapshot_management/snapshots_controller_test.rb
98
98
  - test/test_plugin_helper.rb
99
- homepage: http://www.orcharhino.com
99
+ homepage: https://www.orcharhino.com
100
100
  licenses: []
101
101
  metadata: {}
102
102
  post_install_message: