Removed unnecessary code + Minor improvements

This commit is contained in:
Shital Savekar 2018-05-20 18:34:25 -07:00
Родитель 9b96e3a940
Коммит c1651d853f
3 изменённых файлов: 11 добавлений и 30 удалений

Просмотреть файл

@ -196,7 +196,7 @@ try
}
}
Set-Variable -Name UseAzureResourceManager -Value $true -Scope Global
$SelectedSubscription = RetryOperation -operation { Select-AzureRmSubscription -SubscriptionId $AzureSetup.SubscriptionID } -maxRetryCount 5 -description "Selecting subscription..."
$SelectedSubscription = Select-AzureRmSubscription -SubscriptionId $AzureSetup.SubscriptionID
$subIDSplitted = ($SelectedSubscription.Subscription.SubscriptionId).Split("-")
$userIDSplitted = ($SelectedSubscription.Account.Id).Split("-")
LogMsg "SubscriptionName : $($SelectedSubscription.Subscription.Name)"

Просмотреть файл

@ -2473,7 +2473,7 @@ Function PerformIOTestOnDisk($testVMObject, [string]$attachedDisk, [string]$disk
return $retValue
}
Function RetryOperation($operation, $description, $expectResult=$null, $maxRetryCount=10, $retryInterval=10, [switch]$NoLogsPlease)
Function RetryOperation($operation, $description, $expectResult=$null, $maxRetryCount=10, $retryInterval=10, [switch]$NoLogsPlease, [switch]$ThrowExceptionOnFailure)
{
$retryCount = 1
@ -2520,12 +2520,19 @@ Function RetryOperation($operation, $description, $expectResult=$null, $maxRetry
}
if ($retryCount -ge $maxRetryCount)
{
LogError "Opearation Failed."
LogError "Command '$operation' Failed."
break;
}
} while ($True)
return $null
if ($ThrowExceptionOnFailure)
{
ThrowException -Exception "Command '$operation' Failed."
}
else
{
return $null
}
}
Function GetFilePathsFromLinuxFolder ([string]$folderToSearch, $IpAddress, $SSHPort, $username, $password, $maxRetryCount=20, [string]$expectedFiles)

Просмотреть файл

@ -383,32 +383,6 @@ try
#endregion
#region Download necessary tools.
mkdir -Path .\tools -ErrorAction SilentlyContinue | Out-Null
Import-Module BitsTransfer
if (!( Test-Path -Path .\tools\7za.exe ))
{
Write-Host "Downloading 7za.exe"
$out = Start-BitsTransfer -Source "https://github.com/iamshital/azure-linux-automation-support-files/raw/master/tools/7za.exe" | Out-Null
}
if (!( Test-Path -Path .\tools\dos2unix.exe ))
{
Write-Host "Downloading dos2unix.exe"
$out = Start-BitsTransfer -Source "https://github.com/iamshital/azure-linux-automation-support-files/raw/master/tools/dos2unix.exe" | Out-Null
}
if (!( Test-Path -Path .\tools\plink.exe ))
{
Write-Host "Downloading plink.exe"
$out = Start-BitsTransfer -Source "https://github.com/iamshital/azure-linux-automation-support-files/raw/master/tools/plink.exe" | Out-Null
}
if (!( Test-Path -Path .\tools\pscp.exe ))
{
Write-Host "Downloading pscp.exe"
$out = Start-BitsTransfer -Source "https://github.com/iamshital/azure-linux-automation-support-files/raw/master/tools/pscp.exe" | Out-Null
}
Move-Item -Path "*.exe" -Destination .\tools -ErrorAction SilentlyContinue -Force
#endregion
#region Prepare execution command
$command = ".\AutomationManager.ps1 -xmlConfigFile '$xmlFile' -cycleName 'TC-$shortRandomNumber' -RGIdentifier '$RGIdentifier' -runtests -UseAzureResourceManager"