Skip to content

Commit

Permalink
Merge pull request #511 from HewlettPackard/issue#505
Browse files Browse the repository at this point in the history
Issue#505
  • Loading branch information
nabhajit-ray authored Jan 31, 2023
2 parents 0ce26dd + 405e11f commit 833b897
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 33 deletions.
16 changes: 3 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)
# [v8.1.0-13]
### Notes
- This release supports API4600 minimally where we can use OneView v8.10 with this SDK.
- This release supports API4800 minimally where we can use OneView v8.10 with this SDK.
#### Major Changes

1. Removed Image Streamer support.

### Bug fixes & Enhancements:

- [#505](https://github.com/HewlettPackard/terraform-provider-oneview/issues/505) server profile changes for the management processor are not properly being handled
- [#507](https://github.com/HewlettPackard/terraform-provider-oneview/issues/507) Updates for OneView 6.6 LTS release?
- [#509](https://github.com/HewlettPackard/terraform-provider-oneview/issues/509) ilo settings updated not being commited into state

### Oneview Features supported
Expand Down Expand Up @@ -48,17 +49,6 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
- Storage System
- Uplink Set

# [v8.1.0-13]
### Notes
- This release supports API4600 minimally where we can use OneView v8.10 with this SDK.
#### Major Changes

1. Removed Image Streamer support.

### Bug fixes & Enhancements:

- [#507](https://github.com/HewlettPackard/terraform-provider-oneview/issues/507) Updates for OneView 6.6 LTS release?

### Oneview Features supported
- Appliance SNMPv1 Trap Destinations
- Appliance SNMPv3 Trap Destinations
Expand Down
36 changes: 20 additions & 16 deletions oneview/data_source_server_profile_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1127,25 +1127,29 @@ func dataSourceServerProfileTemplateRead(d *schema.ResourceData, meta interface{
for i := 0; i < len(spt.ConnectionSettings.Connections); i++ {
// Gets Boot for Connection
iscsi := make([]map[string]interface{}, 0, 1)
if spt.ConnectionSettings.Connections[i].Boot.Iscsi != nil {
iscsi = append(iscsi, map[string]interface{}{
"chap_level": spt.ConnectionSettings.Connections[i].Boot.Iscsi.Chaplevel,
"initiator_name_source": spt.ConnectionSettings.Connections[i].Boot.Iscsi.InitiatorNameSource,
"first_boot_target_ip": spt.ConnectionSettings.Connections[i].Boot.Iscsi.FirstBootTargetIp,
"first_boot_target_port": spt.ConnectionSettings.Connections[i].Boot.Iscsi.FirstBootTargetPort,
"second_boot_target_ip": spt.ConnectionSettings.Connections[i].Boot.Iscsi.SecondBootTargetIp,
"second_boot_target_port": spt.ConnectionSettings.Connections[i].Boot.Iscsi.SecondBootTargetPort,
})
}
// Get Boot targets list
targets := make([]map[string]interface{}, 0)
if len(spt.ConnectionSettings.Connections[i].Boot.Targets) != 0 {
for j := 0; j < len(spt.ConnectionSettings.Connections[i].Boot.Targets); j++ {
targets = append(targets, map[string]interface{}{
"array_wwpn": spt.ConnectionSettings.Connections[i].Boot.Targets[j].ArrayWWPN,
"lun": spt.ConnectionSettings.Connections[i].Boot.Targets[j].LUN,
if spt.ConnectionSettings.Connections[i].Boot != nil {
if spt.ConnectionSettings.Connections[i].Boot.Iscsi != nil {
iscsi = append(iscsi, map[string]interface{}{
"chap_level": spt.ConnectionSettings.Connections[i].Boot.Iscsi.Chaplevel,
"initiator_name_source": spt.ConnectionSettings.Connections[i].Boot.Iscsi.InitiatorNameSource,
"first_boot_target_ip": spt.ConnectionSettings.Connections[i].Boot.Iscsi.FirstBootTargetIp,
"first_boot_target_port": spt.ConnectionSettings.Connections[i].Boot.Iscsi.FirstBootTargetPort,
"second_boot_target_ip": spt.ConnectionSettings.Connections[i].Boot.Iscsi.SecondBootTargetIp,
"second_boot_target_port": spt.ConnectionSettings.Connections[i].Boot.Iscsi.SecondBootTargetPort,
})
}

// Get Boot targets list

if len(spt.ConnectionSettings.Connections[i].Boot.Targets) != 0 {
for j := 0; j < len(spt.ConnectionSettings.Connections[i].Boot.Targets); j++ {
targets = append(targets, map[string]interface{}{
"array_wwpn": spt.ConnectionSettings.Connections[i].Boot.Targets[j].ArrayWWPN,
"lun": spt.ConnectionSettings.Connections[i].Boot.Targets[j].LUN,
})
}
}
}

// Gets Boot Settings
Expand Down
3 changes: 2 additions & 1 deletion oneview/resource_server_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,7 @@ func resourceServerProfileRead(d *schema.ResourceData, meta interface{}) error {
}
}
// extracts MpSettings to re-set password

valmpp := flattenMp(d)
if valmpp != nil {
vals := valmpp["administrator_account"].([]interface{})
Expand Down Expand Up @@ -2377,7 +2378,7 @@ func resourceServerProfileRead(d *schema.ResourceData, meta interface{}) error {
for _, connection := range serverProfile.ConnectionSettings.Connections {
iscsi := make([]map[string]interface{}, 0, 1)
connectionBoot := make([]map[string]interface{}, 0, 1)
bootTargets := make([]map[string]interface{}, 0, len(connection.Boot.Targets))
bootTargets := make([]map[string]interface{}, 0, 1)
// Gets Boot Settings
if connection.Boot != nil {

Expand Down
13 changes: 10 additions & 3 deletions oneview/resource_server_profile_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1745,9 +1745,16 @@ func resourceServerProfileTemplateCreate(d *schema.ResourceData, meta interface{
func flattenMp(d *schema.ResourceData) map[string]interface{} {
if val, ok := d.GetOk("management_processor"); ok {
valn := val.([]interface{})
vall := valn[0].(map[string]interface{})
valmp := vall["mp_settings"].([]interface{})
return valmp[0].(map[string]interface{})
if len(valn) != 0 {
vall := valn[0].(map[string]interface{})
if len(vall) != 0 {
valmp := vall["mp_settings"].([]interface{})
if len(valmp) != 0 {
return valmp[0].(map[string]interface{})
}
}
}

}
return nil
}
Expand Down

0 comments on commit 833b897

Please sign in to comment.