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.
- checksums.yaml +4 -4
- data/app/controllers/concerns/foreman_fog_proxmox/hosts_controller.rb +1 -1
- data/app/helpers/proxmox_vm_attrs_helper.rb +1 -1
- data/app/helpers/proxmox_vm_cdrom_helper.rb +1 -1
- data/app/helpers/proxmox_vm_cloudinit_helper.rb +1 -1
- data/app/helpers/proxmox_vm_config_helper.rb +1 -1
- data/app/helpers/proxmox_vm_helper.rb +5 -5
- data/app/helpers/proxmox_vm_interfaces_helper.rb +1 -1
- data/app/helpers/proxmox_vm_os_template_helper.rb +1 -1
- data/app/helpers/proxmox_vm_uuid_helper.rb +1 -1
- data/app/helpers/proxmox_vm_volumes_helper.rb +3 -3
- data/app/models/concerns/host_ext/proxmox/for_vm.rb +1 -1
- data/app/models/foreman_fog_proxmox/proxmox.rb +4 -4
- data/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb +2 -2
- data/app/models/foreman_fog_proxmox/proxmox_vm_new.rb +2 -2
- data/app/models/foreman_fog_proxmox/proxmox_vm_queries.rb +2 -2
- data/app/models/foreman_fog_proxmox/proxmox_volumes.rb +1 -1
- data/app/overrides/compute_resources_vms/form/add_from_profile_to_compute_attributes_form.rb +2 -1
- data/app/overrides/compute_resources_vms/form/update_react_component_to_host_form.rb +2 -1
- data/app/views/compute_resources_vms/form/proxmox/_update_react_component_to_host_form.html.erb +3 -0
- data/db/migrate/20210312105013_update_proxmox_uuid_host.rb +1 -1
- data/lib/foreman_fog_proxmox/engine.rb +22 -27
- data/lib/foreman_fog_proxmox/version.rb +1 -1
- data/package.json +0 -1
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_container_helper_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_server_helper_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_helper_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_uuid_helper_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/helpers/proxmox_vm_volumes_helper_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_compute_attributes_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/proxmox_images_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/proxmox_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/proxmox_version_test.rb +1 -1
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_container_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_create_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cdrom_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_cloudinit_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_hard_disk_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_server_update_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_new_test.rb +2 -2
- data/test/unit/foreman_fog_proxmox/proxmox_vm_queries_test.rb +2 -2
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b4d4330c4fcf2a9c34654f0eb6fd815ff594e92c89cf3087668593c34eb5163
|
4
|
+
data.tar.gz: 299d35d38bc7acc751bcc6029ae81668c77885e008c2f05c44d821b3fc9b41b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a73e32847f12af16d70796f3d197126b4a0ade07d79ba8b5ced0d0c9663131af88d3ddaf21b1feef5dfe9209f066eae59cf0aab54c52ea7053a077bd85dbba13
|
7
|
+
data.tar.gz: bb05744d447e8dddcc864aaa44439cae3d6793f6d7d24b637ba627443cd1d0964c39c63e7adb72fc157284c36b0be9630a82e722765782b17d716a95040a8cc7
|
@@ -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
|
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
|
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
|
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
|
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
|
25
|
-
include
|
26
|
-
include
|
27
|
-
include
|
28
|
-
include
|
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
|
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
|
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
|
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
|
27
|
-
include
|
28
|
-
include
|
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,
|
@@ -23,11 +23,11 @@ require 'foreman_fog_proxmox/value'
|
|
23
23
|
|
24
24
|
module ForemanFogProxmox
|
25
25
|
class Proxmox < ComputeResource
|
26
|
-
include
|
26
|
+
include ProxmoxVMHelper
|
27
27
|
include ProxmoxConnection
|
28
|
-
include
|
29
|
-
include
|
30
|
-
include
|
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
|
23
|
+
module ProxmoxVMCommands
|
24
24
|
include ProxmoxVolumes
|
25
25
|
include ProxmoxPools
|
26
|
-
include
|
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
|
27
|
-
include
|
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
|
21
|
+
module ProxmoxVMQueries
|
22
22
|
include ProxmoxPools
|
23
|
-
include
|
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
|
25
|
+
include ProxmoxVMHelper
|
26
26
|
|
27
27
|
def delete_volume(vm, id, volume_attributes)
|
28
28
|
logger.info("vm #{vm.identity} delete volume #{id}")
|
data/app/overrides/compute_resources_vms/form/add_from_profile_to_compute_attributes_form.rb
CHANGED
@@ -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
|
-
|
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
|
)
|
data/app/views/compute_resources_vms/form/proxmox/_update_react_component_to_host_form.html.erb
CHANGED
@@ -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 %>
|
@@ -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 |
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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::
|
110
|
+
::Host::Base.include HostExt::Proxmox::ForVM
|
116
111
|
::ComputeResourceHostAssociator.include ForemanFogProxmox::ComputeResourceHostAssociator
|
117
112
|
end
|
118
113
|
end
|
data/package.json
CHANGED
@@ -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
|
32
|
-
include
|
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
|
24
|
-
include
|
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
|
24
|
-
include
|
23
|
+
class ProxmoxVMVolumesHelperTest < ActiveSupport::TestCase
|
24
|
+
include ProxmoxVMVolumesHelper
|
25
25
|
|
26
26
|
describe 'remove_deletes' do
|
27
27
|
setup { Fog.mock! }
|
@@ -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
|
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
|
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
|
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
|
27
|
+
class ProxmoxVMCommandsContainerTest < ActiveSupport::TestCase
|
28
28
|
include ComputeResourceTestHelpers
|
29
29
|
include ProxmoxNodeMockFactory
|
30
30
|
include ProxmoxContainerMockFactory
|
31
|
-
include
|
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
|
27
|
+
class ProxmoxVMCommandsServerCreateTest < ActiveSupport::TestCase
|
28
28
|
include ComputeResourceTestHelpers
|
29
29
|
include ProxmoxNodeMockFactory
|
30
30
|
include ProxmoxServerMockFactory
|
31
|
-
include
|
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
|
27
|
+
class ProxmoxVMCommandsServerUpdateCdromTest < ActiveSupport::TestCase
|
28
28
|
include ComputeResourceTestHelpers
|
29
29
|
include ProxmoxNodeMockFactory
|
30
30
|
include ProxmoxServerMockFactory
|
31
|
-
include
|
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
|
27
|
+
class ProxmoxVMCommandsServerUpdateCloudinitTest < ActiveSupport::TestCase
|
28
28
|
include ComputeResourceTestHelpers
|
29
29
|
include ProxmoxNodeMockFactory
|
30
30
|
include ProxmoxServerMockFactory
|
31
|
-
include
|
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
|
27
|
+
class ProxmoxVMCommandsServerUpdateHardDiskTest < ActiveSupport::TestCase # rubocop:disable Metrics/ClassLength
|
28
28
|
include ComputeResourceTestHelpers
|
29
29
|
include ProxmoxNodeMockFactory
|
30
30
|
include ProxmoxServerMockFactory
|
31
|
-
include
|
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
|
27
|
+
class ProxmoxVMCommandsServerUpdateTest < ActiveSupport::TestCase
|
28
28
|
include ComputeResourceTestHelpers
|
29
29
|
include ProxmoxNodeMockFactory
|
30
30
|
include ProxmoxServerMockFactory
|
31
|
-
include
|
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
|
28
|
+
class ProxmoxVMCommandsServerTest < ActiveSupport::TestCase
|
29
29
|
include ComputeResourceTestHelpers
|
30
30
|
include ProxmoxNodeMockFactory
|
31
31
|
include ProxmoxServerMockFactory
|
32
32
|
include ProxmoxContainerMockFactory
|
33
|
-
include
|
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
|
28
|
+
class ProxmoxVMNewTest < ActiveSupport::TestCase
|
29
29
|
include ComputeResourceTestHelpers
|
30
30
|
include ProxmoxNodeMockFactory
|
31
31
|
include ProxmoxServerMockFactory
|
32
32
|
include ProxmoxContainerMockFactory
|
33
|
-
include
|
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
|
28
|
+
class ProxmoxVMQueriesTest < ActiveSupport::TestCase
|
29
29
|
include ComputeResourceTestHelpers
|
30
30
|
include ProxmoxNodeMockFactory
|
31
31
|
include ProxmoxServerMockFactory
|
32
32
|
include ProxmoxContainerMockFactory
|
33
|
-
include
|
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.
|
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-
|
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/
|
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/
|
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/
|
305
|
-
- test/
|
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
|