Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAD: Fix typo and indent #80

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions PowerArubaCP/Public/NetworkDevice.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ function Add-ArubaCPNetworkDevice {
throw "If snmp_version is specified, community_string is mandatory."
}
$snmp_read = @{
snmp_version = $snmp_version.ToUpper()
snmp_version = $snmp_version.ToUpper()
community_string = $community_string
zone_name = "default"
zone_name = "default"
}
$_nad | add-member -name "snmp_read" -membertype NoteProperty -Value $snmp_read
}
Expand Down Expand Up @@ -385,9 +385,9 @@ function Set-ArubaCPNetworkDevice {
throw "If snmp_version is specified, community_string is mandatory."
}
$snmp_read = @{
snmp_version = $snmp_version.ToUpper()
snmp_version = $snmp_version.ToUpper()
community_string = $community_string
zone_name = "default"
zone_name = "default"
}
$_nad | add-member -name "snmp_read" -membertype NoteProperty -Value $snmp_read
}
Expand Down
20 changes: 10 additions & 10 deletions Tests/integration/NetworkDevice.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Describe "Attribute Network Device" {
($nad.attributes).syslocation | Should -Be "Pester"
}

It "Add Attribute Network Device (Add 1 Attribute with 1 Attribute before with hashtable)" {
It "Add Attribute Network Device (Add 1 attribute with 1 attribute before with hashtable)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Add-ArubaCPAttributesMember -attributes @{ "Location" = "PowerArubaCP"; }
Get-ArubaCPNetworkDevice -name pester_SW1 | Add-ArubaCPAttributesMember -attributes @{ "syslocation" = "Pester" }
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
Expand Down Expand Up @@ -258,7 +258,7 @@ Describe "Attribute Network Device" {
($nad.attributes).syslocation | Should -Be "Pester"
}

It "Add Attribute Network Device (Add 1 Attribute with 1 Attribute before with name/value)" {
It "Add Attribute Network Device (Add 1 attribute with 1 attribute before with name/value)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Add-ArubaCPAttributesMember -name "Location" -value "PowerArubaCP"
Get-ArubaCPNetworkDevice -name pester_SW1 | Add-ArubaCPAttributesMember -name syslocation -value Pester
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
Expand All @@ -283,15 +283,15 @@ Describe "Attribute Network Device" {
Add-ArubaCPNetworkDevice -name pester_SW1 -ip_address 192.0.2.1 -radius_secret MySecurePassword -vendor Aruba -description "Add by PowerArubaCP"
}

It "Set Attribute Network Device (Set 1 Attribute with hashtable)" {
It "Set Attribute Network Device (Set 1 attribute with hashtable)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -attributes @{ "Location" = "PowerArubaCP" }
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
$nad.id | Should -Not -Be BeNullOrEmpty
($nad.attributes | Get-Member -MemberType NoteProperty).count | Should -Be "1"
$nad.attributes.location | Should -Be "PowerArubaCP"
}

It "Set Attribute Network Device (Set 2 Attributes with hashtable)" {
It "Set Attribute Network Device (Set 2 attributes with hashtable)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -attributes @{ "Location" = "PowerArubaCP" ; "syslocation" = "Pester" }
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
$nad.id | Should -Not -Be BeNullOrEmpty
Expand All @@ -300,7 +300,7 @@ Describe "Attribute Network Device" {
$nad.attributes.syslocation | Should -Be "Pester"
}

It "Set Attribute Network Device (Set 1 Attribute with 1 Attribute before with hashtable)" {
It "Set Attribute Network Device (Set 1 attribute with 1 attribute before with hashtable)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -attributes @{ "Location" = "PowerArubaCP" }
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -attributes @{ "syslocation" = "Pester" }
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
Expand All @@ -309,15 +309,15 @@ Describe "Attribute Network Device" {
$nad.attributes.syslocation | Should -Be "Pester"
}

It "Set Attribute Network Device (Set 1 Attribute with name/value)" {
It "Set Attribute Network Device (Set 1 attribute with name/value)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -name "Location" -value "PowerArubaCP"
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
$nad.id | Should -Not -Be BeNullOrEmpty
($nad.attributes | Get-Member -MemberType NoteProperty).count | Should -Be "1"
$nad.attributes.location | Should -Be "PowerArubaCP"
}

It "Set Attribute Network Device (Set 2 Attributes with name/value)" {
It "Set Attribute Network Device (Set 2 attributes with name/value)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -name "Location", syslocation -value "PowerArubaCP", Pester
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
$nad.id | Should -Not -Be BeNullOrEmpty
Expand All @@ -326,7 +326,7 @@ Describe "Attribute Network Device" {
$nad.attributes.syslocation | Should -Be "Pester"
}

It "Set Attribute Network Device (Set 1 Attribute with 1 Attribute before with name/value)" {
It "Set Attribute Network Device (Set 1 attribute with 1 attribute before with name/value)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -name "Location" -value "PowerArubaCP"
Get-ArubaCPNetworkDevice -name pester_SW1 | Set-ArubaCPAttributesMember -name syslocation -value Pester
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
Expand All @@ -348,7 +348,7 @@ Describe "Attribute Network Device" {
Add-ArubaCPNetworkDevice -name pester_SW1 -ip_address 192.0.2.1 -radius_secret MySecurePassword -vendor Aruba -description "Add by PowerArubaCP" -attributes @{ "Location" = "PowerArubaCP" ; "syslocation" = "Pester" }
}

It "Remove Attribute Local User (Remove 1 Attribute with 2 before)" {
It "Remove Attribute Local User (Remove 1 attribute with 2 before)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Remove-ArubaCPAttributesMember -name "Location"
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
$nad.id | Should -Not -Be BeNullOrEmpty
Expand All @@ -357,7 +357,7 @@ Describe "Attribute Network Device" {
}

<#Bug ?! get 'No Tag definition specified for this tag value' when remove ALL attributes
It "Remove Attribute Local User (Remove 2 Attributes with 2 before)" {
It "Remove Attribute Local User (Remove 2 attributes with 2 before)" {
Get-ArubaCPNetworkDevice -name pester_SW1 | Remove-ArubaCPAttributesMember -name Location, syslocation
$nad = Get-ArubaCPNetworkDevice -name pester_SW1
$nad.id | Should -Not -Be BeNullOrEmpty
Expand Down