Skip to content

Commit 9118750

Browse files
Code cleanup
1 parent 72ab479 commit 9118750

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTp
140140
github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs=
141141
github.com/IBM/continuous-delivery-go-sdk/v2 v2.0.2 h1:yCJJnSLNYkpF7v9n0tw8CpQbSy43E/NbFOopRf1PgoM=
142142
github.com/IBM/continuous-delivery-go-sdk/v2 v2.0.2/go.mod h1:2MajFr6C5H2jyj7qtjBxAPnZAjbPiK4CAJNk3fKNnPo=
143-
github.com/IBM/event-notifications-go-admin-sdk v0.10.0 h1:SbEG6Z9lJWQxNYexYmLRzF+seFokOW7bRKBgiyfYsls=
144-
github.com/IBM/event-notifications-go-admin-sdk v0.10.0/go.mod h1:za2mdfBpox6hdsKaYTbE5ooCv2im8BYPq5yuKc7x5Ao=
145143
github.com/IBM/event-notifications-go-admin-sdk v0.11.0 h1:X/GhBE6dGRx8s79xYrdmv88ljD/8hSCyh9jMSUPCcCc=
146144
github.com/IBM/event-notifications-go-admin-sdk v0.11.0/go.mod h1:za2mdfBpox6hdsKaYTbE5ooCv2im8BYPq5yuKc7x5Ao=
147145
github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM=

ibm/service/power/resource_ibm_pi_instance.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,6 @@ func resourceIBMPIInstanceUpdate(ctx context.Context, d *schema.ResourceData, me
981981

982982
if d.HasChange(Arg_VirtualSerialNumber + ".0." + Attr_Serial) {
983983
instanceRestart := false
984-
985984
status := d.Get(Attr_Status).(string)
986985
if strings.ToLower(status) != State_Shutoff {
987986
err := stopLparForResourceChange(ctx, client, instanceID, d)
@@ -992,10 +991,7 @@ func resourceIBMPIInstanceUpdate(ctx context.Context, d *schema.ResourceData, me
992991
}
993992

994993
oldVSN, newVSN := d.GetChange(Arg_VirtualSerialNumber)
995-
lenOld := len(oldVSN.([]interface{}))
996-
lenNew := len(newVSN.([]interface{}))
997-
998-
if lenOld > 0 {
994+
if len(oldVSN.([]interface{})) > 0 {
999995
retainVSN := d.Get(Arg_RetainVirtualSerialNumber).(bool)
1000996
deleteBody := &models.DeleteServerVirtualSerialNumber{
1001997
RetainVSN: retainVSN,
@@ -1011,7 +1007,7 @@ func resourceIBMPIInstanceUpdate(ctx context.Context, d *schema.ResourceData, me
10111007
}
10121008
}
10131009

1014-
if lenNew > 0 {
1010+
if len(newVSN.([]interface{})) > 0 {
10151011
newVSNMap := newVSN.([]interface{})[0].(map[string]interface{})
10161012
description := newVSNMap[Attr_Description].(string)
10171013
serial := newVSNMap[Attr_Serial].(string)

0 commit comments

Comments
 (0)