-
Notifications
You must be signed in to change notification settings - Fork 991
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 d4dfa53
Showing
20 changed files
with
129 additions
and
89 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.
20 changes: 20 additions & 0 deletions
20
...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,20 @@ | ||
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 = {} | ||
ctrls_and_vol[:volumes].each_with_index do |vol, index| | ||
volumes[index.to_s] = vol | ||
end | ||
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
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
Oops, something went wrong.