foreman_fog_proxmox 0.16.2 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) 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 +2 -1
  19. data/app/overrides/compute_resources_vms/form/update_react_component_to_host_form.rb +2 -1
  20. data/app/views/compute_resources_vms/form/proxmox/_update_react_component_to_host_form.html.erb +3 -0
  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/package.json +0 -1
  25. data/test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb +1 -1
  26. data/test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb +1 -1
  27. data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb +2 -2
  28. data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb +2 -2
  29. data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb +2 -2
  30. data/test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb +1 -1
  31. data/test/unit/foreman_fog_proxmox/proxmox_images_test.rb +1 -1
  32. data/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb +1 -1
  33. data/test/unit/foreman_fog_proxmox/proxmox_test.rb +1 -1
  34. data/test/unit/foreman_fog_proxmox/proxmox_version_test.rb +1 -1
  35. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb +2 -2
  36. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb +2 -2
  37. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cdrom_test.rb +2 -2
  38. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cloudinit_test.rb +2 -2
  39. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_hard_disk_test.rb +2 -2
  40. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb +2 -2
  41. data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb +2 -2
  42. data/test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb +2 -2
  43. data/test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb +2 -2
  44. metadata +20 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e541fe564b88ed46c9acdce0a10b75bfd963a9d7382004aab237c1ee07eef3c2
4
- data.tar.gz: 1037763c9e114f76150bfbd5359f9b981f376b4f645d8e71d9195615381d6920
3
+ metadata.gz: 5b4d4330c4fcf2a9c34654f0eb6fd815ff594e92c89cf3087668593c34eb5163
4
+ data.tar.gz: 299d35d38bc7acc751bcc6029ae81668c77885e008c2f05c44d821b3fc9b41b0
5
5
  SHA512:
6
- metadata.gz: 33ec2b5af76f6492fb9e5712f1d27689200a4defba3bc4d0e7cef3e76d1e7724943f53c714ca885b2b2d58388e14a60f48b99ef16c0497e819e17592470e417d
7
- data.tar.gz: dfdc69e48e4992631feab480c4a5b2b159abd59f537927d5169934f647bd72c82bdc4644fab12240a37bd6b65a6302b051bae37bf6df886daff50b7288fc299e
6
+ metadata.gz: a73e32847f12af16d70796f3d197126b4a0ade07d79ba8b5ced0d0c9663131af88d3ddaf21b1feef5dfe9209f066eae59cf0aab54c52ea7053a077bd85dbba13
7
+ data.tar.gz: bb05744d447e8dddcc864aaa44439cae3d6793f6d7d24b637ba627443cd1d0964c39c63e7adb72fc157284c36b0be9630a82e722765782b17d716a95040a8cc7
@@ -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,7 +20,8 @@
20
20
  Deface::Override.new(
21
21
  virtual_path: 'compute_attributes/_compute_form',
22
22
  name: 'remove_networks_and_volumes_partial',
23
- remove: "erb[loud]:contains('compute_resources_vms/form/networks'), erb[loud]:contains('compute_resources_vms/form/volumes')"
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 %>"
24
25
  )
25
26
 
26
27
  Deface::Override.new(
@@ -21,5 +21,6 @@ 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'
24
+ :partial => 'compute_resources_vms/form/proxmox/update_react_component_to_host_form',
25
+ :original => 'c71aceb245363af92515509d25cac0c066bd58ed'
25
26
  )
@@ -23,4 +23,7 @@ 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' } %>
26
29
  <% 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.2'
21
+ VERSION = '0.17.1'
22
22
  end
data/package.json CHANGED
@@ -28,7 +28,6 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@babel/core": "^7.7.0",
31
- "@testing-library/react": "^10.4.9",
32
31
  "@theforeman/builder": ">= 12.0.1",
33
32
  "@theforeman/eslint-plugin-foreman": ">= 12.0.1",
34
33
  "@theforeman/find-foreman": ">= 12.0.1",
@@ -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.2
4
+ version: 0.17.1
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-10-02 00:00:00.000000000 Z
12
+ date: 2024-11-07 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/functional/compute_resources_controller_test.rb
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
297
305
  - 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
298
309
  - test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_hard_disk_test.rb
299
- - test/unit/foreman_fog_proxmox/proxmox_vm_commands_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
300
313
  - test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb
301
- - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb
302
314
  - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb
303
315
  - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_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
316
+ - test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb
317
+ - test/functional/compute_resources_controller_test.rb
319
318
  - test/factories/foreman_fog_proxmox/proxmox_server_mock_factory.rb
320
319
  - test/factories/foreman_fog_proxmox/proxmox_container_mock_factory.rb
321
320
  - test/factories/foreman_fog_proxmox/proxmox_node_mock_factory.rb
321
+ - test/factories/proxmox_factory.rb