Skip to content

Commit

Permalink
* Fixed New-HPOVProfile where condition check for bootable connection…
Browse files Browse the repository at this point in the history
…s and presence of -ManageBoot parameter would always fail causing terminating error.
  • Loading branch information
Chris Lynch committed Apr 2, 2015
1 parent 1a6a60a commit 25a25de
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 54 deletions.
Binary file modified HPOneView.120.psd1
Binary file not shown.
43 changes: 34 additions & 9 deletions HPOneView.120.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ THE SOFTWARE.
Get-HPOVSppFile --> Get-HPOVBaseline
Add-HPOVSppFile --> Add-HPOVBaseline
------------------------------------------
1.20.0110.0
1.20.0112.0
| - Fixed New-HPOVProfile where condition check for bootable connections and presence of -ManageBoot parameter would always fail causing terminating error.
#>

#Set HPOneView POSH Library Version
#Increment 3rd string by taking todays day (e.g. 23) and hour in 24hr format (e.g. 14), and adding to the prior value.
$script:scriptVersion = "1.20.0110.0"
$script:scriptVersion = "1.20.0112.0"

#Check to see if another module is loaded in the console, but allow Import-Module to process normally if user specifies the same module name
if ($(get-module -name HPOneView*) -and (-not $(get-module -name HPOneView* | % { $_.name -eq "HPOneView.120"}))) {
Expand Down Expand Up @@ -1736,7 +1736,7 @@ function Send-HPOVRequest {

}

409 {
{ @(409, 412) -contains $_ } {

$errorRecord = New-ErrorRecord InvalidOperationException $global:ResponseErrorObject.errorCode InvalidOperation 'Send-HPOVRequest' -Message ("[Send-HPOVRequest]: $($global:ResponseErrorObject.message) $($global:ResponseErrorObject.recommendedActions)")
Throw $errorRecord
Expand Down Expand Up @@ -12781,7 +12781,7 @@ function New-HPOVNetwork {

$netUri = $script:ethNetworksUri

$net = $net | select name, type, vlanId, smartLink, privateNetwork, purpose, ethernetNetworkType
$net = $net | select name, type, vlanId, smartLink, privateNetwork, purpose, ethernetNetworkType, connectionTemplateUri

}

Expand Down Expand Up @@ -12814,6 +12814,8 @@ function New-HPOVNetwork {

}

if ($net.connectionTemplateUri) { $net.connectionTemplateUri = $Null }

$objStatus = [pscustomobject]@{ Name = $net.Name; Status = $Null; Details = $Null }

#Check if Network Type is Direct Attach and if ManagedFabric parameter is being called at the same time.
Expand Down Expand Up @@ -15779,7 +15781,7 @@ function New-HPOVLogicalInterconnectGroup {
[Parameter(Mandatory = $False,ParameterSetName = "Default",HelpMessage = "Enable SNMP Settings", Position = 8)]
[hashtable]$SNMP = $null,

[Parameter(Mandatory = $True,ParameterSetName = "Import",HelpMessage = "Specify JSON source file to great Logical Interconnect Group")]
[Parameter(Mandatory = $True,ParameterSetName = "Import",HelpMessage = "Specify JSON source file to create Logical Interconnect Group")]
[ValidateScript({split-path $_ | Test-Path})]
[Alias('i')]
[object]$Import
Expand Down Expand Up @@ -17227,8 +17229,8 @@ function New-HPOVProfile {

}

if ($manageBoot.IsPresent) { [Bool]$manageBoot = $True }
else { [Bool]$manageBoot = $False }
#if ($manageBoot.IsPresent) { [Bool]$manageBoot = $True }
#else { [Bool]$manageBoot = $False }

#New Server Resource Object
$serverProfile = [pscustomobject]@{
Expand All @@ -17253,7 +17255,7 @@ function New-HPOVProfile {
};
boot = [PSCustomObject]@{

manageBoot = [bool]$manageBoot;
manageBoot = $manageBoot.IsPresent;
order = $bootOrder

};
Expand Down Expand Up @@ -17600,7 +17602,10 @@ function New-HPOVProfile {
}

if ((-not($manageBoot.IsPresent)) -and $BootableConnections.count -gt 0) {

write-host "ManageBoot Type" + ($manageBoot.gettype().fullname)
write-host "ManageBoot Present? " $manageBoot.IsPresent
write-host "Bootable Connections: " $BootableConnections.count

$errorRecord = New-ErrorRecord HPOneView.ServerProfileResourceException BootableConnectionsFound InvalidArgument 'manageBoot' -Message "Bootable Connections $($BootableConnections -join ",") were found, however the -manageBoot switch parameter was not provided. Please correct your command syntax and try again." #-verbose
$pscmdlet.ThrowTerminatingError($errorRecord)

Expand Down Expand Up @@ -20952,6 +20957,26 @@ function Remove-HPOVLdap {

}

}

Function Set-HPOVLdapDefaultDomain {


# .ExternalHelp HPOneView.120.psm1-help.xml

[CmdletBinding()]
param(
[Parameter(Position=0, Mandatory = $true)]
[String]$Name = $Null
)

Begin {}
Process {}
End {}




}

function New-HPOVLdapServer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<SupportedUICultures>
<UICulture>
<UICultureName>en-US</UICultureName>
<UICultureVersion>1.20.110.6</UICultureVersion>
<UICultureVersion>1.20.112.8</UICultureVersion>
</UICulture>
</SupportedUICultures>
</HelpInfo>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ModuleInfo>
<ModuleContentURI>http://www.hp.com/go/powershell/updatehelp/</ModuleContentURI>
<Version>1.20.110.2</Version>
<Version>1.20.112.2</Version>
</ModuleInfo>
1 change: 1 addition & 0 deletions Samples/BLGen9_Server_Multiconnection_Sample.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ $params = @{
connections = $conList
bootMode = "UEFI";
pxeBootPolicy = "IPv4ThenIPv6";
manageBoot = $True;
bootOrder = "HardDisk";
HideUnusedFlexnics = $True
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/Server_Multiconnection_AA_VC_Sample.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if ($maxPower.optionLinks) {
}

#Create Profile
New-HPOVProfile -name $profileName -server Unassigned -serverHardwareType $serverType -eg "Prod VC FlexFabric Group 1" -connections $conList -boot -bootOrder $bootOrder -bios -biosSettings $biosSettings | Wait-HPOVTaskComplete
New-HPOVProfile -name $profileName -server Unassigned -serverHardwareType $serverType -eg "Prod VC FlexFabric Group 1" -connections $conList -manageBoot -bootOrder $bootOrder -bios -biosSettings $biosSettings | Wait-HPOVTaskComplete

# Display the connections for our profile
Get-HPOVProfileConnectionList $profileName
Expand Down
Loading

0 comments on commit 25a25de

Please sign in to comment.