Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into radjabov
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryguy committed May 22, 2024
2 parents 1a44af0 + f844743 commit d35589a
Show file tree
Hide file tree
Showing 17 changed files with 945 additions and 943 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ plugins:
rubocop:
enabled: true
config: ".rubocop_cc.yml"
channel: rubocop-0-82
channel: rubocop-1-56-3
exclude_patterns:
- node_modules/
- spec/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: Report code coverage
if: "${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.0' }}"
continue-on-error: true
uses: paambaati/codeclimate-action@v5
uses: paambaati/codeclimate-action@v6
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.2.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ManageIQ::Providers::IbmCloud::ContainerManager < ManageIQ::Providers::Kub
METRICS_ROLES = %w[prometheus].freeze

supports :metrics do
unsupported_reason_add(:metrics, _("No metrics endpoint has been added")) unless metrics_endpoint_exists?
_("No metrics endpoint has been added") unless metrics_endpoint_exists?
end

def metrics_endpoint_exists?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::Template

supports :provisioning do
if ext_management_system
unsupported_reason_add(:provisioning, ext_management_system.unsupported_reason(:provisioning)) unless ext_management_system.supports?(:provisioning)
ext_management_system.unsupported_reason(:provisioning)
else
unsupported_reason_add(:provisioning, _('not connected to ems'))
_('not connected to ems')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,44 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::Vm < Man
supports :capture
supports :terminate
supports :reboot_guest do
unsupported_reason_add(:reboot_guest, _("The VM is not powered on")) unless current_state == "on"
_("The VM is not powered on") unless current_state == "on"
end
supports :reset do
unsupported_reason_add(:reset, _("The VM is not powered on")) unless current_state == "on"
_("The VM is not powered on") unless current_state == "on"
end
supports :snapshots
supports :snapshot_create
supports :revert_to_snapshot do
unsupported_reason_add(:revert_to_snapshot, _("Cannot revert to snapshot while VM is running")) unless current_state == "off"
_("Cannot revert to snapshot while VM is running") unless current_state == "off"
end
supports :remove_snapshot
supports :remove_all_snapshots

supports_not :suspend

supports :publish do
reason = _("Publish not supported because VM is blank") if blank?
reason ||= _("Publish not supported because VM is orphaned") if orphaned?
reason ||= _("Publish not supported because VM is archived") if archived?
unsupported_reason_add(:publish, reason) if reason
return _("Publish not supported because VM is blank") if blank?
return _("Publish not supported because VM is orphaned") if orphaned?
return _("Publish not supported because VM is archived") if archived?
end

# TODO: converge these all into console and use unsupported_reason(:console) for all
supports :html5_console do
reason = _("VM Console not supported because VM is not powered on") unless current_state == "on"
reason ||= _("VM Console not supported because VM is orphaned") if orphaned?
reason ||= _("VM Console not supported because VM is archived") if archived?
unsupported_reason_add(:html5_console, reason) if reason
return _("VM Console not supported because VM is not powered on") unless current_state == "on"
return _("VM Console not supported because VM is orphaned") if orphaned?
return _("VM Console not supported because VM is archived") if archived?
end
supports :launch_html5_console

supports :native_console do
reason ||= _("VM Console not supported because VM is orphaned") if orphaned?
reason ||= _("VM Console not supported because VM is archived") if archived?
unsupported_reason_add(:native_console, reason) if reason
return _("VM Console not supported because VM is orphaned") if orphaned?
return _("VM Console not supported because VM is archived") if archived?
end

supports :resize do
unsupported_reason_add(:resize, _('The VM is not powered off')) unless current_state == "off"
unsupported_reason_add(:resize, _('The VM is not connected to a provider')) unless ext_management_system
unsupported_reason_add(:resize, _('SAP VM resize not supported')) if flavor.kind_of?(ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::SAPProfile)
return _('The VM is not powered off') unless current_state == "off"
return _('The VM is not connected to a provider') unless ext_management_system
return _('SAP VM resize not supported') if flavor.kind_of?(ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::SAPProfile)
end

def cloud_instance_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class ManageIQ::Providers::IbmCloud::PowerVirtualServers::NetworkManager::CloudSubnet < ::CloudSubnet
supports :create
supports :delete do
if number_of(:vms) > 0
unsupported_reason_add(:delete, _("The Network has active VMIs related to it"))
end
_("The Network has active VMIs related to it") if number_of(:vms) > 0
end

def self.params_for_create(_ems)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::StorageManager::CloudV
supports :create
supports :clone
supports :delete do
unsupported_reason_add(:delete, _("the volume is not connected to an active Provider")) unless ext_management_system
unsupported_reason_add(:delete, _("cannot delete volume that is in use.")) if status == "in-use"
return _("the volume is not connected to an active Provider") unless ext_management_system
return _("cannot delete volume that is in use.") if status == "in-use"
end
supports_not :snapshot_create
supports_not :update
supports :attach do
unsupported_reason_add(:attach, _("the volume is not connected to an active Provider")) unless ext_management_system
unsupported_reason_add(:attach, _("cannot attach non-shareable volume that is in use.")) if status == "in-use" && !multi_attachment
return _("the volume is not connected to an active Provider") unless ext_management_system
return _("cannot attach non-shareable volume that is in use.") if status == "in-use" && !multi_attachment
end
supports :detach do
unsupported_reason_add(:detach, _("the volume is not connected to an active Provider")) unless ext_management_system
unsupported_reason_add(:detach, _("the volume status is '%{status}' but should be 'in-use'") % {:status => status}) unless status == "in-use"
return _("the volume is not connected to an active Provider") unless ext_management_system
return _("the volume status is '%{status}' but should be 'in-use'") % {:status => status} unless status == "in-use"
end

def available_vms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class ManageIQ::Providers::IbmCloud::VPC::CloudManager::Template < ManageIQ::Pro

supports :provisioning do
if ext_management_system
unsupported_reason_add(:provisioning, ext_management_system.unsupported_reason(:provisioning)) unless ext_management_system.supports_provisioning?
ext_management_system.unsupported_reason(:provisioning)
else
unsupported_reason_add(:provisioning, _('not connected to ems'))
_('not connected to ems')
end
end

Expand Down
10 changes: 5 additions & 5 deletions app/models/manageiq/providers/ibm_cloud/vpc/cloud_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def raw_pause

# Show reboot in the instance menu when on.
supports :reboot_guest do
unsupported_reason_add(:reboot_guest, _('The VM is not powered on')) unless current_state == 'on'
_('The VM is not powered on') unless current_state == 'on'
end

# Gracefully reboot the quest.
Expand All @@ -92,7 +92,7 @@ def raw_reboot_guest(force: false)

# Tell UI to show reset in UI only when VM is on.
supports :reset do
unsupported_reason_add(:reset, _('The VM is not powered on')) unless current_state == "on"
_('The VM is not powered on') unless current_state == "on"
end

# Force the the VM to restart.
Expand All @@ -101,7 +101,7 @@ def raw_reset
end

supports :terminate do
unsupported_reason_add(:terminate, unsupported_reason(:control)) unless supports_control?
unsupported_reason(:control)
end

def raw_destroy
Expand All @@ -112,8 +112,8 @@ def raw_destroy
end

supports :resize do
unsupported_reason_add(:resize, _('The VM is not powered off')) unless current_state == "off"
unsupported_reason_add(:resize, _('The VM is not connected to a provider')) unless ext_management_system
return _('The VM is not powered off') unless current_state == "off"
return _('The VM is not connected to a provider') unless ext_management_system
end

def raw_resize(options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class ManageIQ::Providers::IbmCloud::VPC::NetworkManager::CloudNetwork < ::Cloud
supports :create
supports :delete do
if ext_management_system.nil?
unsupported_reason_add(:delete_cloud_network, _("The Cloud Network is not connected to an active %{table}") % {
_("The Cloud Network is not connected to an active %{table}") % {
:table => ui_lookup(:table => "ext_management_systems")
})
}
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ class ManageIQ::Providers::IbmCloud::VPC::NetworkManager::CloudSubnet < ::CloudS
supports :create
supports :delete do
if ext_management_system.nil?
unsupported_reason_add(:delete, _("The subnet is not connected to an active %{table}") % {
_("The subnet is not connected to an active %{table}") % {
:table => ui_lookup(:table => "ext_management_systems")
})
end
if number_of(:vms) > 0
unsupported_reason_add(:delete, _("The subnet has an active %{table}") % {
}
elsif number_of(:vms) > 0
_("The subnet has an active %{table}") % {
:table => ui_lookup(:table => "vm_cloud")
})
}
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ class ManageIQ::Providers::IbmCloud::VPC::StorageManager::CloudVolume < ::CloudV
supports :create
supports :delete do
if ext_management_system.nil?
unsupported_reason_add(:delete_volume, _("The Cloud Volume is not connected to an active %{table}") % {
_("The Cloud Volume is not connected to an active %{table}") % {
:table => ui_lookup(:table => "ext_management_systems")
})
}
end
end

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"npm": ">= 6.0.0",
"yarn": ">= 0.20.1"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.2.2"
}
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

0 comments on commit d35589a

Please sign in to comment.