Skip to content

Commit 52b7b67

Browse files
authored
Simplify import
1 parent a8c7fc0 commit 52b7b67

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

storage_drivers/ontap/ontap_nas_flexgroup.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
tridentconfig "github.com/netapp/trident/config"
1818
. "github.com/netapp/trident/logging"
1919
"github.com/netapp/trident/pkg/capacity"
20-
collection2 "github.com/netapp/trident/pkg/collection"
20+
"github.com/netapp/trident/pkg/collection"
2121
"github.com/netapp/trident/pkg/convert"
2222
"github.com/netapp/trident/storage"
2323
sa "github.com/netapp/trident/storage_attribute"
@@ -474,7 +474,7 @@ func (d *NASFlexGroupStorageDriver) validate(ctx context.Context) error {
474474
}
475475

476476
if len(d.Config.FlexGroupAggregateList) > 0 {
477-
containsAll, _ := collection2.ContainsElements(vserverAggrs, d.Config.FlexGroupAggregateList)
477+
containsAll, _ := collection.ContainsElements(vserverAggrs, d.Config.FlexGroupAggregateList)
478478
if !containsAll {
479479
return fmt.Errorf("not all aggregates specified in the flexgroupAggregateList are assigned to the SVM; flexgroupAggregateList: %v assigned aggregates: %v",
480480
d.Config.FlexGroupAggregateList, vserverAggrs)
@@ -540,15 +540,15 @@ func (d *NASFlexGroupStorageDriver) Create(
540540
// get options with default fallback values
541541
// see also: ontap_common.go#PopulateConfigurationDefaults
542542
var (
543-
spaceReserve = collection2.GetV(opts, "spaceReserve", storagePool.InternalAttributes()[SpaceReserve])
544-
snapshotPolicy = collection2.GetV(opts, "snapshotPolicy", storagePool.InternalAttributes()[SnapshotPolicy])
545-
snapshotReserve = collection2.GetV(opts, "snapshotReserve", storagePool.InternalAttributes()[SnapshotReserve])
546-
unixPermissions = collection2.GetV(opts, "unixPermissions", storagePool.InternalAttributes()[UnixPermissions])
547-
snapshotDir = collection2.GetV(opts, "snapshotDir", storagePool.InternalAttributes()[SnapshotDir])
548-
exportPolicy = collection2.GetV(opts, "exportPolicy", storagePool.InternalAttributes()[ExportPolicy])
549-
securityStyle = collection2.GetV(opts, "securityStyle", storagePool.InternalAttributes()[SecurityStyle])
550-
encryption = collection2.GetV(opts, "encryption", storagePool.InternalAttributes()[Encryption])
551-
tieringPolicy = collection2.GetV(opts, "tieringPolicy", storagePool.InternalAttributes()[TieringPolicy])
543+
spaceReserve = collection.GetV(opts, "spaceReserve", storagePool.InternalAttributes()[SpaceReserve])
544+
snapshotPolicy = collection.GetV(opts, "snapshotPolicy", storagePool.InternalAttributes()[SnapshotPolicy])
545+
snapshotReserve = collection.GetV(opts, "snapshotReserve", storagePool.InternalAttributes()[SnapshotReserve])
546+
unixPermissions = collection.GetV(opts, "unixPermissions", storagePool.InternalAttributes()[UnixPermissions])
547+
snapshotDir = collection.GetV(opts, "snapshotDir", storagePool.InternalAttributes()[SnapshotDir])
548+
exportPolicy = collection.GetV(opts, "exportPolicy", storagePool.InternalAttributes()[ExportPolicy])
549+
securityStyle = collection.GetV(opts, "securityStyle", storagePool.InternalAttributes()[SecurityStyle])
550+
encryption = collection.GetV(opts, "encryption", storagePool.InternalAttributes()[Encryption])
551+
tieringPolicy = collection.GetV(opts, "tieringPolicy", storagePool.InternalAttributes()[TieringPolicy])
552552
qosPolicy = storagePool.InternalAttributes()[QosPolicy]
553553
adaptiveQosPolicy = storagePool.InternalAttributes()[AdaptiveQosPolicy]
554554
)
@@ -865,13 +865,13 @@ func (d *NASFlexGroupStorageDriver) CreateClone(
865865
storagePoolSplitOnCloneVal = d.Config.SplitOnClone
866866
}
867867

868-
split, err := strconv.ParseBool(collection2.GetV(opts, "splitOnClone", storagePoolSplitOnCloneVal))
868+
split, err := strconv.ParseBool(collection.GetV(opts, "splitOnClone", storagePoolSplitOnCloneVal))
869869
if err != nil {
870870
return fmt.Errorf("invalid boolean value for splitOnClone: %v", err)
871871
}
872872

873-
qosPolicy := collection2.GetV(opts, "qosPolicy", "")
874-
adaptiveQosPolicy := collection2.GetV(opts, "adaptiveQosPolicy", "")
873+
qosPolicy := collection.GetV(opts, "qosPolicy", "")
874+
adaptiveQosPolicy := collection.GetV(opts, "adaptiveQosPolicy", "")
875875
qosPolicyGroup, err := api.NewQosPolicyGroup(qosPolicy, adaptiveQosPolicy)
876876
if err != nil {
877877
return err

storage_drivers/ontap/ontap_nas_qtree.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/netapp/trident/internal/crypto"
2222
. "github.com/netapp/trident/logging"
2323
"github.com/netapp/trident/pkg/capacity"
24-
collection2 "github.com/netapp/trident/pkg/collection"
24+
"github.com/netapp/trident/pkg/collection"
2525
"github.com/netapp/trident/pkg/convert"
2626
"github.com/netapp/trident/pkg/network"
2727
"github.com/netapp/trident/storage"
@@ -381,17 +381,17 @@ func (d *NASQtreeStorageDriver) Create(
381381
// Get Flexvol options with default fallback values
382382
// see also: ontap_common.go#PopulateConfigurationDefaults
383383
var (
384-
spaceReserve = collection2.GetV(opts, "spaceReserve", storagePool.InternalAttributes()[SpaceReserve])
385-
snapshotPolicy = collection2.GetV(opts, "snapshotPolicy", storagePool.InternalAttributes()[SnapshotPolicy])
384+
spaceReserve = collection.GetV(opts, "spaceReserve", storagePool.InternalAttributes()[SpaceReserve])
385+
snapshotPolicy = collection.GetV(opts, "snapshotPolicy", storagePool.InternalAttributes()[SnapshotPolicy])
386386
snapshotReserve = storagePool.InternalAttributes()[SnapshotReserve]
387-
snapshotDir = collection2.GetV(opts, "snapshotDir", storagePool.InternalAttributes()[SnapshotDir])
388-
encryption = collection2.GetV(opts, "encryption", storagePool.InternalAttributes()[Encryption])
387+
snapshotDir = collection.GetV(opts, "snapshotDir", storagePool.InternalAttributes()[SnapshotDir])
388+
encryption = collection.GetV(opts, "encryption", storagePool.InternalAttributes()[Encryption])
389389

390390
// Get qtree options with default fallback values
391-
unixPermissions = collection2.GetV(opts, "unixPermissions", storagePool.InternalAttributes()[UnixPermissions])
392-
exportPolicy = collection2.GetV(opts, "exportPolicy", storagePool.InternalAttributes()[ExportPolicy])
393-
securityStyle = collection2.GetV(opts, "securityStyle", storagePool.InternalAttributes()[SecurityStyle])
394-
tieringPolicy = collection2.GetV(opts, "tieringPolicy", storagePool.InternalAttributes()[TieringPolicy])
391+
unixPermissions = collection.GetV(opts, "unixPermissions", storagePool.InternalAttributes()[UnixPermissions])
392+
exportPolicy = collection.GetV(opts, "exportPolicy", storagePool.InternalAttributes()[ExportPolicy])
393+
securityStyle = collection.GetV(opts, "securityStyle", storagePool.InternalAttributes()[SecurityStyle])
394+
tieringPolicy = collection.GetV(opts, "tieringPolicy", storagePool.InternalAttributes()[TieringPolicy])
395395
qosPolicy = storagePool.InternalAttributes()[QosPolicy]
396396
)
397397

@@ -1773,7 +1773,7 @@ func (d *NASQtreeStorageDriver) pruneUnusedFlexvols(ctx context.Context) {
17731773
for flexvol, initialEmptyTime := range d.emptyFlexvolMap {
17741774

17751775
// If Flexvol is no longer known to the driver, remove from map and move on
1776-
if !collection2.StringInSlice(flexvol, flexvols) {
1776+
if !collection.StringInSlice(flexvol, flexvols) {
17771777
Logc(ctx).WithField("flexvol", flexvol).Debug(
17781778
"Flexvol no longer extant, removing from delete deferral map.")
17791779
delete(d.emptyFlexvolMap, flexvol)

0 commit comments

Comments
 (0)