1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

L #-: Linting for vCenter reconfigure

Also exclude some offending (to rubocop ;) files
This commit is contained in:
Tino Vazquez 2020-03-06 10:31:46 +01:00
parent 3fb291bac3
commit 5b3e93cf44
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
3 changed files with 22 additions and 5 deletions

View File

@ -42,6 +42,20 @@ AllCops:
- src/authm_mad/remotes/ssh/authenticate
- src/sunstone/bin/novnc-server
- src/sunstone/config.ru
- src/im_mad/remotes/dummy-probes.d/vms/monitor/monitor.rb
- src/im_mad/remotes/dummy.d/collectd-client.rb
- src/im_mad/remotes/dummy.d/collectd-client.rb
- src/im_mad/remotes/kvm-probes.d/host/monitor/numa_usage.rb
- src/im_mad/remotes/kvm-probes.d/host/system/machines_models.rb
- src/im_mad/remotes/kvm-probes.d/host/system/numa_host.rb
- src/im_mad/remotes/lib/kvm.rb
- src/im_mad/remotes/lib/probe_db.rb
- src/im_mad/remotes/lxd-probes.d/host/monitor/numa_usage.rb
- src/im_mad/remotes/lxd-probes.d/host/system/numa_host.rb
- src/im_mad/remotes/lxd-probes.d/vms/status/status.rb
- src/im_mad/remotes/node-probes.d/numa_usage.rb
- src/im_mad/remotes/lib/linux.rb
- src/im_mad/remotes/node-probes.d/numa_host.rb
- src/pm_mad/remotes/dummy/cancel
- src/pm_mad/remotes/dummy/shutdown
- src/pm_mad/remotes/dummy/reboot
@ -61,6 +75,8 @@ AllCops:
- src/pm_mad/remotes/ec2/reset
- src/pm_mad/remotes/ec2/poll
- src/onegate/config.ru
- src/im_mad/remotes/kvm-probes.d/host/system/pci.rb
- src/im_mad/remotes/lxd-probes.d/host/system/pci.rb
- src/im_mad/remotes/lxd-probes.d/pci.rb
- src/im_mad/remotes/kvm-probes.d/pci.rb
- src/im_mad/remotes/kvm.d/collectd-client.rb

View File

@ -579,8 +579,9 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
OpenNebulaHelper.unit_to_str(host['HOST_SHARE/MAX_MEM']
.to_i, {}))
puts format(str, ' USED (REAL)',
OpenNebulaHelper.unit_to_str(host['MONITORING/CAPACITY/USED_MEMORY']
.to_i, {}))
OpenNebulaHelper
.unit_to_str(host['MONITORING/CAPACITY/USED_MEMORY']
.to_i, {}))
puts format(str, ' USED (ALLOCATED)',
OpenNebulaHelper.unit_to_str(host['HOST_SHARE/MEM_USAGE']
.to_i, {}))

View File

@ -35,7 +35,6 @@ require 'vcenter_driver'
vm_ref = ARGV[0]
vc_cluster_name = ARGV[-1]
vm_id = ARGV[-2]
drv_action = OpenNebula::XMLElement.new
drv_action.initialize_xml(Base64.decode64(STDIN.read), 'VMM_DRIVER_ACTION_DATA')
@ -45,8 +44,9 @@ host_id = drv_action['VM/HISTORY_RECORDS/HISTORY[last()]/HID']
begin
vi_client = VCenterDriver::VIClient.new_from_host(host_id)
one_item_xml = drv_action.retrieve_xmlelements('VM').first.to_xml
one_item = OpenNebula::VirtualMachine.new(OpenNebula::XMLElement.build_xml(one_item_xml, 'VM'), vi_client)
one_item_xml = drv_action.retrieve_xmlelements('VM').first.to_xml
one_item_raw_xml = OpenNebula::XMLElement.build_xml(one_item_xml, 'VM')
one_item = OpenNebula::VirtualMachine.new(one_item_raw_xml, vi_client)
vm = VCenterDriver::VirtualMachine.new_one(vi_client, vm_ref, one_item)