-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #34839 - Add support for NVME Controllers
- Loading branch information
1 parent
5b00e9e
commit 4baa998
Showing
21 changed files
with
131 additions
and
92 deletions.
There are no files selected for viewing
19 changes: 0 additions & 19 deletions
19
app/controllers/concerns/foreman/controller/normalize_scsi_attributes.rb
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...controllers/concerns/foreman/controller/normalize_vmware_storage_controller_attributes.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Foreman::Controller::NormalizeVmwareStorageControllerAttributes | ||
extend ActiveSupport::Concern | ||
|
||
private | ||
|
||
def normalize_vmware_storage_controller_attributes(attrs) | ||
ctrls_and_vol = JSON.parse(attrs["controllers"]). | ||
deep_transform_keys { |key| key.to_s.underscore }. | ||
deep_symbolize_keys | ||
volumes = {} | ||
volumes = ctrls_and_vol[:volumes].each_with_index.to_h { |vol, index| [index.to_s, vol] } | ||
attrs["nvme_controllers"], attrs["scsi_controllers"] = ctrls_and_vol[:controllers]&.partition { |controller| controller[:type].include?("VirtualNVMEController") } | ||
attrs.delete("controllers") | ||
attrs["volumes_attributes"] = volumes | ||
|
||
attrs | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
group :vmware do | ||
gem 'fog-vsphere', '>= 3.6.4', '< 4.0' | ||
gem 'fog-vsphere', git: 'https://github.com/girijaasoni/fog-vsphere.git', branch: 'nvme-controllers' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.