foreman_fog_proxmox 0.16.3 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/foreman_fog_proxmox/hosts_controller.rb +1 -1
  3. data/app/helpers/proxmox_vm_attrs_helper.rb +1 -1
  4. data/app/helpers/proxmox_vm_cdrom_helper.rb +1 -1
  5. data/app/helpers/proxmox_vm_cloudinit_helper.rb +1 -1
  6. data/app/helpers/proxmox_vm_config_helper.rb +1 -1
  7. data/app/helpers/proxmox_vm_helper.rb +5 -5
  8. data/app/helpers/proxmox_vm_interfaces_helper.rb +1 -1
  9. data/app/helpers/proxmox_vm_os_template_helper.rb +1 -1
  10. data/app/helpers/proxmox_vm_uuid_helper.rb +1 -1
  11. data/app/helpers/proxmox_vm_volumes_helper.rb +3 -3
  12. data/app/models/concerns/host_ext/proxmox/for_vm.rb +1 -1
  13. data/app/models/foreman_fog_proxmox/proxmox.rb +4 -4
  14. data/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb +2 -2
  15. data/app/models/foreman_fog_proxmox/proxmox_vm_new.rb +2 -2
  16. data/app/models/foreman_fog_proxmox/proxmox_vm_queries.rb +2 -2
  17. data/app/models/foreman_fog_proxmox/proxmox_volumes.rb +1 -1
  18. data/app/overrides/compute_resources_vms/form/add_from_profile_to_compute_attributes_form.rb +1 -2
  19. data/app/overrides/compute_resources_vms/form/update_react_component_to_host_form.rb +1 -2
  20. data/app/views/compute_resources_vms/form/proxmox/_update_react_component_to_host_form.html.erb +0 -3
  21. data/db/migrate/20210312105013_update_proxmox_uuid_host.rb +1 -1
  22. data/lib/foreman_fog_proxmox/engine.rb +22 -27
  23. data/lib/foreman_fog_proxmox/version.rb +1 -1
  24. data/test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb +1 -1
  25. data/test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb +1 -1
  26. data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb +2 -2
  27. data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb +2 -2
  28. data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb +2 -2
  29. data/test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb +1 -1
  30. data/test/unit/foreman_fog_proxmox/proxmox_images_test.rb +1 -1
  31. data/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb +1 -1
  32. data/test/unit/foreman_fog_proxmox/proxmox_test.rb +1 -1
  33. data/test/unit/foreman_fog_proxmox/proxmox_version_test.rb +1 -1
  34. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb +2 -2
  35. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb +2 -2
  36. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cdrom_test.rb +2 -2
  37. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cloudinit_test.rb +2 -2
  38. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_hard_disk_test.rb +2 -2
  39. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb +2 -2
  40. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb +2 -2
  41. data/test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb +2 -2
  42. data/test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb +2 -2
  43. metadata +20 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af6ccc8c3f032a49324fd0c47999b1b70e768e9dd7b8c1b3893ab518cc1f2d60
4
- data.tar.gz: d96cc32fd61acc5ccc76675382a25d5716e949e57c941c47998027476c655593
3
+ metadata.gz: 4521dde2dff786a4f14fcf50c4eb68cd412596029a0f2ee32d54bd8154c51135
4
+ data.tar.gz: 6e316973c79ab4e51f95578e3c282a0d5345dde397afb5d14ad9ac011a8fc9d0
5
5
  SHA512:
6
- metadata.gz: b8cda57050030292ca7b28d4c78bd4e89399451fda2094739b8826b737eb6e9cdfaba714ecbd71582e52d757ee0e9ca24eedc7249d54e0caf36c123ee76d6422
7
- data.tar.gz: 6f0c6182521d0870ca30a21ccb4eb409497d6f049579b6d705c86b6ada7144415527df0cb3b741560ddfe0a25507787d7a4e122cd37f9a2661efb8aa60c8e7a0
6
+ metadata.gz: 9d034e8a37538e334329ab3a8df9447325ca7d2809a0b185819bc0fe62757fc39cee691799fa8699802d50855da41d3e4f8df17a3a2ffe1924376dfbcbacfc20
7
+ data.tar.gz: '09e3bd0ebb1cd6ece7103cc0d07f0d0c5a0c02598a8f72787359599ee8a8004c6c3add7d9d43a7ffdd9b2486c4fe2faeb5fa28b05ddc83cf290fe0ff55211b5a'
@@ -24,7 +24,7 @@ module ForemanFogProxmox
24
24
  prepend Overrides
25
25
  end
26
26
  module Overrides
27
- include ForemanFogProxmox::ProxmoxVmNew
27
+ include ForemanFogProxmox::ProxmoxVMNew
28
28
  # Clone the host
29
29
  def clone
30
30
  super
@@ -24,7 +24,7 @@ require 'foreman_fog_proxmox/value'
24
24
  require 'foreman_fog_proxmox/hash_collection'
25
25
 
26
26
  # Convert a foreman form server hash into a fog-proxmox server attributes hash
27
- module ProxmoxVmAttrsHelper
27
+ module ProxmoxVMAttrsHelper
28
28
  def object_to_attributes_hash(vms, from_profile, start_checked)
29
29
  param_scope = from_profile ? "compute_attribute[vm_attrs]" : "host[compute_attributes]"
30
30
  vm_h = ActiveSupport::HashWithIndifferentAccess.new
@@ -23,7 +23,7 @@ require 'foreman_fog_proxmox/value'
23
23
  require 'foreman_fog_proxmox/hash_collection'
24
24
 
25
25
  # Convert a foreman form server hash into a fog-proxmox server attributes hash
26
- module ProxmoxVmCdromHelper
26
+ module ProxmoxVMCdromHelper
27
27
  def parse_server_cdrom(args)
28
28
  cdrom_media = args['cdrom'] if args.key?('cdrom')
29
29
  cdrom_image = args['volid'] if args.key?('volid')
@@ -23,7 +23,7 @@ require 'foreman_fog_proxmox/value'
23
23
  require 'foreman_fog_proxmox/hash_collection'
24
24
 
25
25
  # Convert a foreman form server hash into a fog-proxmox server attributes hash
26
- module ProxmoxVmCloudinitHelper
26
+ module ProxmoxVMCloudinitHelper
27
27
  def parse_server_cloudinit(args)
28
28
  cloudinit_h = {}
29
29
  cloudinit = args['cloudinit']
@@ -24,7 +24,7 @@ require 'foreman_fog_proxmox/value'
24
24
  require 'foreman_fog_proxmox/hash_collection'
25
25
 
26
26
  # Convert a foreman form server hash into a fog-proxmox server attributes hash
27
- module ProxmoxVmConfigHelper
27
+ module ProxmoxVMConfigHelper
28
28
  def object_to_config_hash(vm, type)
29
29
  vm_h = ActiveSupport::HashWithIndifferentAccess.new
30
30
  main_a = ['vmid', 'type']
@@ -21,11 +21,11 @@ require 'fog/proxmox/helpers/disk_helper'
21
21
  require 'fog/proxmox/helpers/nic_helper'
22
22
  require 'foreman_fog_proxmox/value'
23
23
 
24
- module ProxmoxVmHelper
25
- include ProxmoxVmInterfacesHelper
26
- include ProxmoxVmVolumesHelper
27
- include ProxmoxVmConfigHelper
28
- include ProxmoxVmOsTemplateHelper
24
+ module ProxmoxVMHelper
25
+ include ProxmoxVMInterfacesHelper
26
+ include ProxmoxVMVolumesHelper
27
+ include ProxmoxVMConfigHelper
28
+ include ProxmoxVMOsTemplateHelper
29
29
 
30
30
  def vm_collection(type)
31
31
  collection = :servers
@@ -23,7 +23,7 @@ require 'foreman_fog_proxmox/value'
23
23
  require 'foreman_fog_proxmox/hash_collection'
24
24
 
25
25
  # Convert a foreman form server hash into a fog-proxmox server attributes hash
26
- module ProxmoxVmInterfacesHelper
26
+ module ProxmoxVMInterfacesHelper
27
27
  def parsed_typed_interfaces(args, type, parsed_vm)
28
28
  interfaces_to_add, interfaces_to_delete = parse_typed_interfaces(args, type)
29
29
  interfaces_to_add.each { |interface| parsed_vm = parsed_vm.merge(interface) }
@@ -22,7 +22,7 @@ require 'fog/proxmox/helpers/nic_helper'
22
22
  require 'foreman_fog_proxmox/value'
23
23
  require 'foreman_fog_proxmox/hash_collection'
24
24
 
25
- module ProxmoxVmOsTemplateHelper
25
+ module ProxmoxVMOsTemplateHelper
26
26
  def ostemplate_keys
27
27
  ['ostemplate_storage', 'ostemplate_file']
28
28
  end
@@ -17,7 +17,7 @@
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
- module ProxmoxVmUuidHelper
20
+ module ProxmoxVMUuidHelper
21
21
  UUID_REGEXP = /(?<cluster_id>\d+)_(?<vmid>\d+)/.freeze
22
22
  def extract(uuid, name)
23
23
  captures_h = uuid ? UUID_REGEXP.match(uuid.to_s) : { cluster_id: '', vmid: '' }
@@ -23,9 +23,9 @@ require 'foreman_fog_proxmox/value'
23
23
  require 'foreman_fog_proxmox/hash_collection'
24
24
 
25
25
  # Convert a foreman form server hash into a fog-proxmox server attributes hash
26
- module ProxmoxVmVolumesHelper
27
- include ProxmoxVmCdromHelper
28
- include ProxmoxVmCloudinitHelper
26
+ module ProxmoxVMVolumesHelper
27
+ include ProxmoxVMCdromHelper
28
+ include ProxmoxVMCloudinitHelper
29
29
 
30
30
  def add_disk_options(disk, args)
31
31
  options = ForemanFogProxmox::HashCollection.new_hash_reject_keys(args,
@@ -19,7 +19,7 @@
19
19
 
20
20
  module HostExt
21
21
  module Proxmox
22
- module ForVm
22
+ module ForVM
23
23
  extend ActiveSupport::Concern
24
24
  module ClassMethods
25
25
  def for_vm_uuid(cr, vm)
@@ -23,11 +23,11 @@ require 'foreman_fog_proxmox/value'
23
23
 
24
24
  module ForemanFogProxmox
25
25
  class Proxmox < ComputeResource
26
- include ProxmoxVmHelper
26
+ include ProxmoxVMHelper
27
27
  include ProxmoxConnection
28
- include ProxmoxVmNew
29
- include ProxmoxVmCommands
30
- include ProxmoxVmQueries
28
+ include ProxmoxVMNew
29
+ include ProxmoxVMCommands
30
+ include ProxmoxVMQueries
31
31
  include ProxmoxComputeAttributes
32
32
  include ProxmoxVolumes
33
33
  include ProxmoxInterfaces
@@ -20,10 +20,10 @@
20
20
  require 'foreman_fog_proxmox/hash_collection'
21
21
 
22
22
  module ForemanFogProxmox
23
- module ProxmoxVmCommands
23
+ module ProxmoxVMCommands
24
24
  include ProxmoxVolumes
25
25
  include ProxmoxPools
26
- include ProxmoxVmHelper
26
+ include ProxmoxVMHelper
27
27
 
28
28
  def start_on_boot(vm, args)
29
29
  startonboot = args[:start_after_create].blank? ? false : Foreman::Cast.to_bool(args[:start_after_create])
@@ -23,8 +23,8 @@ require 'fog/proxmox/helpers/disk_helper'
23
23
  require 'foreman_fog_proxmox/hash_collection'
24
24
 
25
25
  module ForemanFogProxmox
26
- module ProxmoxVmNew
27
- include ProxmoxVmHelper
26
+ module ProxmoxVMNew
27
+ include ProxmoxVMHelper
28
28
 
29
29
  def cdrom_defaults
30
30
  { storage_type: 'cdrom', id: 'ide2', volid: 'none', media: 'cdrom' }
@@ -18,9 +18,9 @@
18
18
  # along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
20
  module ForemanFogProxmox
21
- module ProxmoxVmQueries
21
+ module ProxmoxVMQueries
22
22
  include ProxmoxPools
23
- include ProxmoxVmUuidHelper
23
+ include ProxmoxVMUuidHelper
24
24
 
25
25
  def nodes
26
26
  nodes = client.nodes.all if client
@@ -22,7 +22,7 @@ require 'foreman_fog_proxmox/hash_collection'
22
22
 
23
23
  module ForemanFogProxmox
24
24
  module ProxmoxVolumes
25
- include ProxmoxVmHelper
25
+ include ProxmoxVMHelper
26
26
 
27
27
  def delete_volume(vm, id, volume_attributes)
28
28
  logger.info("vm #{vm.identity} delete volume #{id}")
@@ -20,8 +20,7 @@
20
20
  Deface::Override.new(
21
21
  virtual_path: 'compute_attributes/_compute_form',
22
22
  name: 'remove_networks_and_volumes_partial',
23
- surround: "erb[loud]:contains('compute_resources_vms/form/networks'), erb[loud]:contains('compute_resources_vms/form/volumes')",
24
- text: "<% unless compute_resource.class == ForemanFogProxmox::Proxmox %><%= render_original %><% end %>"
23
+ remove: "erb[loud]:contains('compute_resources_vms/form/networks'), erb[loud]:contains('compute_resources_vms/form/volumes')"
25
24
  )
26
25
 
27
26
  Deface::Override.new(
@@ -21,6 +21,5 @@ Deface::Override.new(
21
21
  :virtual_path => 'hosts/_compute',
22
22
  :name => 'update_react_component_to_virtual_machine_tab',
23
23
  :replace => "erb[loud]:contains('hosts/compute_detail')",
24
- :partial => 'compute_resources_vms/form/proxmox/update_react_component_to_host_form',
25
- :original => 'c71aceb245363af92515509d25cac0c066bd58ed'
24
+ :partial => 'compute_resources_vms/form/proxmox/update_react_component_to_host_form'
26
25
  )
@@ -23,7 +23,4 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
23
23
  <%= render :partial => provider_partial(compute_resource, 'base'),
24
24
  locals: { f: compute, host: host, compute_resource: compute_resource, new_host: host.new_record?, new_vm: !compute.object.persisted?,
25
25
  arch: host.architecture_id, os: host.operatingsystem_id } %>
26
-
27
- <!--Storage-->
28
- <%= render :partial => 'compute_resources_vms/form/volumes', :locals => { :f => compute, :compute_resource => compute_resource, :new_host => !compute.object.persisted?, :new_vm => !compute.object.persisted?, :item_layout => 'removable' } %>
29
26
  <% end %>
@@ -1,4 +1,4 @@
1
- include ProxmoxVmUuidHelper
1
+ include ProxmoxVMUuidHelper
2
2
  class UpdateProxmoxUuidHost < ActiveRecord::Migration[6.0]
3
3
  def up
4
4
  execute(sql(:concat))
@@ -23,13 +23,6 @@ module ForemanFogProxmox
23
23
  class Engine < ::Rails::Engine
24
24
  engine_name 'foreman_fog_proxmox'
25
25
 
26
- config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
27
- config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
28
- config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
29
- config.autoload_paths += Dir["#{config.root}/app/services/concerns"]
30
- config.autoload_paths += Dir["#{config.root}/app/overrides"]
31
- config.autoload_paths += Dir["#{config.root}/app/services"]
32
-
33
26
  # Add any db migrations
34
27
  initializer 'foreman_fog_proxmox.load_app_instance_data' do |app|
35
28
  ForemanFogProxmox::Engine.paths['db/migrate'].existent.each do |path|
@@ -37,25 +30,27 @@ module ForemanFogProxmox
37
30
  end
38
31
  end
39
32
 
40
- initializer 'foreman_fog_proxmox.register_plugin', :before => :finisher_hook do |_app|
41
- Foreman::Plugin.register :foreman_fog_proxmox do
42
- requires_foreman '>= 1.22.0'
43
- # Add Global files for extending foreman-core components and routes
44
- register_global_js_file 'global'
45
- # Register Proxmox VE compute resource in foreman
46
- compute_resource ForemanFogProxmox::Proxmox
47
- parameter_filter(ComputeResource, :uuid)
48
- # add dashboard widget
49
- widget 'foreman_fog_proxmox_widget', name: N_('Foreman Fog Proxmox widget'), sizex: 8, sizey: 1
50
- security_block :foreman_fog_proxmox do
51
- permission :view_compute_resources, { :'foreman_fog_proxmox/compute_resources' =>
52
- [:ostemplates_by_id_and_node_and_storage,
53
- :isos_by_id_and_node_and_storage,
54
- :ostemplates_by_id_and_node,
55
- :isos_by_id_and_node,
56
- :storages_by_id_and_node,
57
- :iso_storages_by_id_and_node,
58
- :bridges_by_id_and_node] }
33
+ initializer 'foreman_fog_proxmox.register_plugin', :before => :finisher_hook do |app|
34
+ app.reloader.to_prepare do
35
+ Foreman::Plugin.register :foreman_fog_proxmox do
36
+ requires_foreman '>= 1.22.0'
37
+ # Add Global files for extending foreman-core components and routes
38
+ register_global_js_file 'global'
39
+ # Register Proxmox VE compute resource in foreman
40
+ compute_resource ForemanFogProxmox::Proxmox
41
+ parameter_filter(ComputeResource, :uuid)
42
+ # add dashboard widget
43
+ widget 'foreman_fog_proxmox_widget', name: N_('Foreman Fog Proxmox widget'), sizex: 8, sizey: 1
44
+ security_block :foreman_fog_proxmox do
45
+ permission :view_compute_resources, { :'foreman_fog_proxmox/compute_resources' =>
46
+ [:ostemplates_by_id_and_node_and_storage,
47
+ :isos_by_id_and_node_and_storage,
48
+ :ostemplates_by_id_and_node,
49
+ :isos_by_id_and_node,
50
+ :storages_by_id_and_node,
51
+ :iso_storages_by_id_and_node,
52
+ :bridges_by_id_and_node] }
53
+ end
59
54
  end
60
55
  end
61
56
  end
@@ -112,7 +107,7 @@ module ForemanFogProxmox
112
107
  ::Host::Managed.include Orchestration::Proxmox::Compute
113
108
  ::Host::Managed.include HostExt::Proxmox::Interfaces
114
109
  ::Host::Managed.include HostExt::Proxmox::Associator
115
- ::Host::Base.include HostExt::Proxmox::ForVm
110
+ ::Host::Base.include HostExt::Proxmox::ForVM
116
111
  ::ComputeResourceHostAssociator.include ForemanFogProxmox::ComputeResourceHostAssociator
117
112
  end
118
113
  end
@@ -18,5 +18,5 @@
18
18
  # along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
20
  module ForemanFogProxmox
21
- VERSION = '0.16.3'
21
+ VERSION = '0.17.0'
22
22
  end
@@ -21,7 +21,7 @@ require 'test_plugin_helper'
21
21
 
22
22
  module ForemanFogProxmox
23
23
  class ProxmoxContainerHelperTest < ActiveSupport::TestCase
24
- include ProxmoxVmHelper
24
+ include ProxmoxVMHelper
25
25
 
26
26
  describe 'parse' do
27
27
  setup { Fog.mock! }
@@ -21,7 +21,7 @@ require 'test_plugin_helper'
21
21
 
22
22
  module ForemanFogProxmox
23
23
  class ProxmoxServerHelperTest < ActiveSupport::TestCase
24
- include ProxmoxVmHelper
24
+ include ProxmoxVMHelper
25
25
 
26
26
  describe 'parse' do
27
27
  setup { Fog.mock! }
@@ -28,8 +28,8 @@ require 'fog/proxmox/compute/models/snapshots'
28
28
  require 'fog/proxmox/compute/models/tasks'
29
29
 
30
30
  module ForemanFogProxmox
31
- class ProxmoxVmHelperTest < ActiveSupport::TestCase
32
- include ProxmoxVmHelper
31
+ class ProxmoxVMHelperTest < ActiveSupport::TestCase
32
+ include ProxmoxVMHelper
33
33
 
34
34
  let(:container) do
35
35
  service = mock('service')
@@ -20,8 +20,8 @@
20
20
  require 'test_plugin_helper'
21
21
 
22
22
  module ForemanFogProxmox
23
- class ProxmoxVmUuidHelperTest < ActiveSupport::TestCase
24
- include ProxmoxVmUuidHelper
23
+ class ProxmoxVMUuidHelperTest < ActiveSupport::TestCase
24
+ include ProxmoxVMUuidHelper
25
25
 
26
26
  describe 'extract_vmid' do
27
27
  setup { Fog.mock! }
@@ -20,8 +20,8 @@
20
20
  require 'test_plugin_helper'
21
21
 
22
22
  module ForemanFogProxmox
23
- class ProxmoxVmVolumesHelperTest < ActiveSupport::TestCase
24
- include ProxmoxVmVolumesHelper
23
+ class ProxmoxVMVolumesHelperTest < ActiveSupport::TestCase
24
+ include ProxmoxVMVolumesHelper
25
25
 
26
26
  describe 'remove_deletes' do
27
27
  setup { Fog.mock! }
@@ -30,7 +30,7 @@ module ForemanFogProxmox
30
30
  include ProxmoxNodeMockFactory
31
31
  include ProxmoxServerMockFactory
32
32
  include ProxmoxContainerMockFactory
33
- include ProxmoxVmHelper
33
+ include ProxmoxVMHelper
34
34
 
35
35
  describe 'host_compute_attrs' do
36
36
  before do
@@ -21,7 +21,7 @@ require 'test_plugin_helper'
21
21
  require 'active_support/core_ext/hash/indifferent_access'
22
22
 
23
23
  module ForemanFogProxmox
24
- class ProxmoxVmCommandsServerTest < ActiveSupport::TestCase
24
+ class ProxmoxVMCommandsServerTest < ActiveSupport::TestCase
25
25
  include ComputeResourceTestHelpers
26
26
 
27
27
  describe 'clone_from_image' do
@@ -30,7 +30,7 @@ module ForemanFogProxmox
30
30
  include ProxmoxNodeMockFactory
31
31
  include ProxmoxServerMockFactory
32
32
  include ProxmoxContainerMockFactory
33
- include ProxmoxVmHelper
33
+ include ProxmoxVMHelper
34
34
 
35
35
  describe 'host_interfaces_attrs' do
36
36
  before do
@@ -30,7 +30,7 @@ module ForemanFogProxmox
30
30
  include ProxmoxNodeMockFactory
31
31
  include ProxmoxServerMockFactory
32
32
  include ProxmoxContainerMockFactory
33
- include ProxmoxVmHelper
33
+ include ProxmoxVMHelper
34
34
 
35
35
  should validate_presence_of(:url)
36
36
  should validate_presence_of(:user)
@@ -24,7 +24,7 @@ require 'active_support/core_ext/hash/indifferent_access'
24
24
  module ForemanFogProxmox
25
25
  class ProxmoxVersionTest < ActiveSupport::TestCase
26
26
  include ComputeResourceTestHelpers
27
- include ProxmoxVmHelper
27
+ include ProxmoxVMHelper
28
28
 
29
29
  wrong_version = { version: '5.a', release: '5.a-1' }.with_indifferent_access
30
30
  supported_version = { version: '5.4', release: '5.4-3' }.with_indifferent_access
@@ -24,11 +24,11 @@ require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
24
24
  require 'active_support/core_ext/hash/indifferent_access'
25
25
 
26
26
  module ForemanFogProxmox
27
- class ProxmoxVmCommandsContainerTest < ActiveSupport::TestCase
27
+ class ProxmoxVMCommandsContainerTest < ActiveSupport::TestCase
28
28
  include ComputeResourceTestHelpers
29
29
  include ProxmoxNodeMockFactory
30
30
  include ProxmoxContainerMockFactory
31
- include ProxmoxVmHelper
31
+ include ProxmoxVMHelper
32
32
 
33
33
  describe 'save_vm' do
34
34
  before do
@@ -24,11 +24,11 @@ require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
24
24
  require 'active_support/core_ext/hash/indifferent_access'
25
25
 
26
26
  module ForemanFogProxmox
27
- class ProxmoxVmCommandsServerCreateTest < ActiveSupport::TestCase
27
+ class ProxmoxVMCommandsServerCreateTest < ActiveSupport::TestCase
28
28
  include ComputeResourceTestHelpers
29
29
  include ProxmoxNodeMockFactory
30
30
  include ProxmoxServerMockFactory
31
- include ProxmoxVmHelper
31
+ include ProxmoxVMHelper
32
32
 
33
33
  describe 'create_vm' do
34
34
  it 'raises Foreman::Exception when vmid <= 100 and vmid > 0' do
@@ -24,11 +24,11 @@ require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
24
24
  require 'active_support/core_ext/hash/indifferent_access'
25
25
 
26
26
  module ForemanFogProxmox
27
- class ProxmoxVmCommandsServerUpdateCdromTest < ActiveSupport::TestCase
27
+ class ProxmoxVMCommandsServerUpdateCdromTest < ActiveSupport::TestCase
28
28
  include ComputeResourceTestHelpers
29
29
  include ProxmoxNodeMockFactory
30
30
  include ProxmoxServerMockFactory
31
- include ProxmoxVmHelper
31
+ include ProxmoxVMHelper
32
32
 
33
33
  describe 'save_vm' do
34
34
  before do
@@ -24,11 +24,11 @@ require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
24
24
  require 'active_support/core_ext/hash/indifferent_access'
25
25
 
26
26
  module ForemanFogProxmox
27
- class ProxmoxVmCommandsServerUpdateCloudinitTest < ActiveSupport::TestCase
27
+ class ProxmoxVMCommandsServerUpdateCloudinitTest < ActiveSupport::TestCase
28
28
  include ComputeResourceTestHelpers
29
29
  include ProxmoxNodeMockFactory
30
30
  include ProxmoxServerMockFactory
31
- include ProxmoxVmHelper
31
+ include ProxmoxVMHelper
32
32
 
33
33
  describe 'save_vm' do
34
34
  before do
@@ -24,11 +24,11 @@ require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
24
24
  require 'active_support/core_ext/hash/indifferent_access'
25
25
 
26
26
  module ForemanFogProxmox
27
- class ProxmoxVmCommandsServerUpdateHardDiskTest < ActiveSupport::TestCase # rubocop:disable Metrics/ClassLength
27
+ class ProxmoxVMCommandsServerUpdateHardDiskTest < ActiveSupport::TestCase # rubocop:disable Metrics/ClassLength
28
28
  include ComputeResourceTestHelpers
29
29
  include ProxmoxNodeMockFactory
30
30
  include ProxmoxServerMockFactory
31
- include ProxmoxVmHelper
31
+ include ProxmoxVMHelper
32
32
 
33
33
  # rubocop:disable Metrics/BlockLength
34
34
  describe 'save_vm' do
@@ -24,11 +24,11 @@ require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
24
24
  require 'active_support/core_ext/hash/indifferent_access'
25
25
 
26
26
  module ForemanFogProxmox
27
- class ProxmoxVmCommandsServerUpdateTest < ActiveSupport::TestCase
27
+ class ProxmoxVMCommandsServerUpdateTest < ActiveSupport::TestCase
28
28
  include ComputeResourceTestHelpers
29
29
  include ProxmoxNodeMockFactory
30
30
  include ProxmoxServerMockFactory
31
- include ProxmoxVmHelper
31
+ include ProxmoxVMHelper
32
32
 
33
33
  describe 'save_vm' do
34
34
  before do
@@ -25,12 +25,12 @@ require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
25
25
  require 'active_support/core_ext/hash/indifferent_access'
26
26
 
27
27
  module ForemanFogProxmox
28
- class ProxmoxVmCommandsServerTest < ActiveSupport::TestCase
28
+ class ProxmoxVMCommandsServerTest < ActiveSupport::TestCase
29
29
  include ComputeResourceTestHelpers
30
30
  include ProxmoxNodeMockFactory
31
31
  include ProxmoxServerMockFactory
32
32
  include ProxmoxContainerMockFactory
33
- include ProxmoxVmHelper
33
+ include ProxmoxVMHelper
34
34
 
35
35
  describe 'destroy_vm' do
36
36
  it 'handles situation when vm is not present' do
@@ -25,12 +25,12 @@ require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
25
25
  require 'active_support/core_ext/hash/indifferent_access'
26
26
 
27
27
  module ForemanFogProxmox
28
- class ProxmoxVmNewTest < ActiveSupport::TestCase
28
+ class ProxmoxVMNewTest < ActiveSupport::TestCase
29
29
  include ComputeResourceTestHelpers
30
30
  include ProxmoxNodeMockFactory
31
31
  include ProxmoxServerMockFactory
32
32
  include ProxmoxContainerMockFactory
33
- include ProxmoxVmHelper
33
+ include ProxmoxVMHelper
34
34
 
35
35
  describe 'new_vm' do
36
36
  before do
@@ -25,12 +25,12 @@ require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
25
25
  require 'active_support/core_ext/hash/indifferent_access'
26
26
 
27
27
  module ForemanFogProxmox
28
- class ProxmoxVmQueriesTest < ActiveSupport::TestCase
28
+ class ProxmoxVMQueriesTest < ActiveSupport::TestCase
29
29
  include ComputeResourceTestHelpers
30
30
  include ProxmoxNodeMockFactory
31
31
  include ProxmoxServerMockFactory
32
32
  include ProxmoxContainerMockFactory
33
- include ProxmoxVmHelper
33
+ include ProxmoxVMHelper
34
34
 
35
35
  describe 'find_vm_by_uuid' do
36
36
  it 'returns nil when the uuid does not match' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_fog_proxmox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.3
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tristan Robert
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-11-07 00:00:00.000000000 Z
12
+ date: 2024-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: deface
@@ -293,29 +293,29 @@ signing_key:
293
293
  specification_version: 4
294
294
  summary: Foreman plugin that adds Proxmox VE compute resource using fog-proxmox
295
295
  test_files:
296
- - test/test_plugin_helper.rb
297
- - test/unit/foreman_fog_proxmox/proxmox_test.rb
298
- - test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb
299
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cloudinit_test.rb
300
- - test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb
301
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
302
- - test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb
303
- - test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb
304
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb
296
+ - test/functional/compute_resources_controller_test.rb
305
297
  - test/unit/foreman_fog_proxmox/semver_test.rb
306
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb
307
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cdrom_test.rb
308
- - test/unit/foreman_fog_proxmox/proxmox_version_test.rb
309
298
  - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_hard_disk_test.rb
310
- - test/unit/foreman_fog_proxmox/proxmox_images_test.rb
311
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb
312
- - test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb
299
+ - test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
313
300
  - test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb
301
+ - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb
314
302
  - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
315
303
  - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb
316
- - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb
317
- - test/functional/compute_resources_controller_test.rb
304
+ - test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb
305
+ - test/unit/foreman_fog_proxmox/proxmox_version_test.rb
306
+ - test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb
307
+ - test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb
308
+ - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb
309
+ - test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb
310
+ - test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb
311
+ - test/unit/foreman_fog_proxmox/proxmox_images_test.rb
312
+ - test/unit/foreman_fog_proxmox/proxmox_test.rb
313
+ - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cdrom_test.rb
314
+ - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cloudinit_test.rb
315
+ - test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb
316
+ - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb
317
+ - test/test_plugin_helper.rb
318
+ - test/factories/proxmox_factory.rb
318
319
  - test/factories/foreman_fog_proxmox/proxmox_server_mock_factory.rb
319
320
  - test/factories/foreman_fog_proxmox/proxmox_container_mock_factory.rb
320
321
  - test/factories/foreman_fog_proxmox/proxmox_node_mock_factory.rb
321
- - test/factories/proxmox_factory.rb