Skip to content

Commit 016f441

Browse files
Merge pull request #494 from surajssd/remove-packer
base: Remove packer package
2 parents 52563b6 + 47d76fa commit 016f441

File tree

3 files changed

+36
-39
lines changed

3 files changed

+36
-39
lines changed

linux/base.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ RUN tdnf update -y --refresh && \
100100
golang \
101101
ruby \
102102
rubygems \
103-
packer \
104103
dcos-cli \
105104
ripgrep \
106105
helm \

linux/powershell/PSCloudShellUtility/PSCloudShellUtility.psm1

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ function Copy-FromCloudShell
459459
-ExceptionObject $PSCmdlet
460460
return
461461
}
462-
462+
463463
if ($item -is [System.IO.FileInfo])
464464
{
465465
# item is a file, go ahead to download. Note: No check is necessary because get-item has done that.
@@ -480,7 +480,7 @@ function Copy-FromCloudShell
480480

481481
# Zip the directory. Note using jar instead of zip is to ignore original top-level folder structure.
482482
$null = jar cMvf $tmp -C $fullPath .
483-
483+
484484
if ((Microsoft.PowerShell.Management\Test-Path -Path $tmp) -or (Microsoft.PowerShell.Management\Test-Path -LiteralPath $tmp))
485485
{
486486
Write-Verbose "Downloading $tmp" -Verbose
@@ -770,7 +770,7 @@ function Get-CloudShellTip
770770

771771
if(-not [string]::IsNullOrEmpty($randomTip))
772772
{
773-
$message = "MOTD: " + $randomTip
773+
$message = "MOTD: " + $randomTip
774774
$message = "`r`n" + $message + "`r`n";
775775
}
776776
}
@@ -889,8 +889,8 @@ function Invoke-AzVMCommand
889889
Provide UserName when connecting to Linux Targets. When used with KeyFilePath parameter, identifies the user on the remote computer
890890
891891
.PARAMETER KeyFilePath
892-
Provide SSH KeyFile Path when connecting to Linux Targets, if connection uses Key based authentication
893-
892+
Provide SSH KeyFile Path when connecting to Linux Targets, if connection uses Key based authentication
893+
894894
.EXAMPLE
895895
Invoke-AzVMCommand -Name WindowsVM -ResourceGroupName ResourceGroupName -ScriptBlock ScriptBlock -Credential credential
896896
@@ -928,7 +928,7 @@ function Invoke-AzVMCommand
928928
[ValidateNotNullOrEmpty()]
929929
[string]$KeyFilePath
930930
)
931-
931+
932932
if(-not (Test-AzResourceGroup -ResourceGroupName $ResourceGroupName)) {
933933
$badResourceGroup = $LocalizedData.TestAzResourceGroup -f ($ResourceGroupName)
934934
throw [System.ArgumentException] $badResourceGroup
@@ -948,25 +948,25 @@ function Invoke-AzVMCommand
948948
{
949949
$message = $LocalizedData.CredentialError
950950
throw [System.ArgumentException] $message
951-
}
951+
}
952952
}
953953

954954
$cName = Test-AzVM @testAzVMParams
955955
if(-not $cName) {
956956
$message = $LocalizedData.GetAzureVMError -f ($Name)
957957
throw [System.ArgumentException] $message
958958
}
959-
959+
960960
if ([OStype]::Windows -eq $OsType)
961961
{
962962
$invokeCommandParams = @{
963963
ComputerName = $cName
964964
UseSSL = $true
965965
Credential = $Credential
966966
SessionOption = $script:sessionOption
967-
ScriptBlock = $ScriptBlock
967+
ScriptBlock = $ScriptBlock
968968
Authentication = 'Basic'
969-
}
969+
}
970970
}
971971
elseif ([OStype]::Linux -eq $OsType)
972972
{
@@ -992,7 +992,7 @@ function Invoke-AzVMCommand
992992
}
993993
}
994994

995-
Invoke-Command @invokeCommandParams -ErrorAction Stop
995+
Invoke-Command @invokeCommandParams -ErrorAction Stop
996996
}
997997

998998
function Get-AzVmNsg
@@ -1024,7 +1024,7 @@ function Get-AzVmNsg
10241024
| Foreach-Object `
10251025
{ `
10261026
if ($_.NetworkInterfaces -and ($_.NetworkInterfaces.Id -eq $azVMNetInterfacesId)) `
1027-
{
1027+
{
10281028
$nsg+=$_
10291029
} `
10301030
}
@@ -1088,7 +1088,7 @@ function Get-AzVMPSRemoting
10881088

10891089
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
10901090
$Nsg
1091-
)
1091+
)
10921092

10931093
$protocol = @{https = $false; http = $false; ssh = $false}
10941094

@@ -1138,7 +1138,7 @@ function Enable-AzVMPSRemoting
11381138

11391139
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
11401140
[string]$ResourceGroupName,
1141-
1141+
11421142
[ValidateSet('http','https','ssh')]
11431143
[string]$Protocol,
11441144

@@ -1186,10 +1186,10 @@ function Enable-AzVMPSRemoting
11861186
if($Protocol -eq 'https')
11871187
{
11881188
if (-not $psremoting.Https)
1189-
{
1189+
{
11901190
$null = Az.Network\Add-AzNetworkSecurityRuleConfig -Name 'allow-winrm-https' -DestinationPortRange 5986 @parameters | Az.Network\Set-AzNetworkSecurityGroup
11911191
}
1192-
1192+
11931193
# Setup WinRM HTTPS based remoting using Self-Signed Certificate
11941194
$runCommandParameters =
11951195
@{
@@ -1274,7 +1274,7 @@ function Enable-AzVMPSRemoting
12741274
# 1) Install powershellcore in linux, if not already present
12751275
# 2) backup current sshd_config, configure sshd_config to enable PasswordAuthentication, register powershell subsystem with ssh daemon
12761276
# (#2 is required to support interactive username/password authentication over powershell-ssh)
1277-
# 3) Restart the ssh daemon service to pick up the new config changes
1277+
# 3) Restart the ssh daemon service to pick up the new config changes
12781278
$runCommandParameters =
12791279
@{
12801280
commandId = 'RunShellScript'
@@ -1286,8 +1286,8 @@ function Enable-AzVMPSRemoting
12861286

12871287
$null = Az.Resources\Invoke-AzResourceAction -ResourceId $azureVM.Id -Action runCommand -Parameters $runCommandParameters -ApiVersion 2017-03-30 -Force
12881288
}
1289-
}
1290-
}
1289+
}
1290+
}
12911291
}
12921292

12931293
function Disable-AzVMPSRemoting
@@ -1339,7 +1339,7 @@ function Disable-AzVMPSRemoting
13391339
{
13401340
$OsType = Get-OsType -Name $Name -ResourceGroupName $ResourceGroupName
13411341
}
1342-
1342+
13431343
$azVMNsgs = Get-AzVmNsg -Name $Name -ResourceGroupName $ResourceGroupName
13441344

13451345
if ([OStype]::Windows -eq $OsType)
@@ -1500,7 +1500,7 @@ function Test-AzVM
15001500
[string]$ResourceGroupName,
15011501

15021502
[Parameter(Mandatory=$true)]
1503-
[OSType]$OsType
1503+
[OSType]$OsType
15041504
)
15051505

15061506
$azVMNsgs = Get-AzVmNsg -Name $Name -ResourceGroupName $ResourceGroupName
@@ -1511,10 +1511,10 @@ function Test-AzVM
15111511
$psRemoting = Get-AzVMPSRemoting -Name $Name -ResourceGroupName $ResourceGroupName -Nsg $azVMNsg
15121512

15131513
if ((([OStype]::Windows -eq $OsType) -and (-not $psRemoting.https)) -or (([OStype]::Linux -eq $OsType) -and (-not $psRemoting.ssh)))
1514-
{
1514+
{
15151515
$errMsg = $LocalizedData.TestAzPsRemotingError -f ($Name, $ResourceGroupName)
1516-
throw $errMsg
1517-
}
1516+
throw $errMsg
1517+
}
15181518
}
15191519

15201520
# Check the communication with the remote machine
@@ -1695,7 +1695,7 @@ function GetCommand {
16951695
return $commands
16961696
}
16971697

1698-
function GetAcronymContent
1698+
function GetAcronymContent
16991699
{
17001700
# Get the acronyms file
17011701
$path = Join-Path -Path $PSScriptRoot -ChildPath 'PSCloudShellUtilityAcronyms.json'
@@ -1710,25 +1710,25 @@ function GetAcronymContent
17101710
}
17111711

17121712
function RedirectOnlineHelp($Parameters)
1713-
{
1713+
{
17141714
try {
17151715
Microsoft.PowerShell.Core\Get-Help @Parameters
17161716
}
17171717
catch [System.Management.Automation.PSInvalidOperationException]
17181718
{
17191719
$err = $_
17201720
$matchFound = $err.Exception.Message -match "No program or browser is associated to open the URI (?<link>\w+:\/\/[\w@][\w.:@]+\/?[\w\.?=%&=\-@/$,]*)."
1721-
1721+
17221722
if(($matchFound -eq $True) -and (-not [string]::IsNullOrEmpty($env:ACC_TERM_ID))) {
17231723
$targetLink = $matches["link"]
17241724
Write-Verbose "Redirecting to $targetLink"
17251725

1726-
$uri = "http://localhost:8888/openLink/$($env:ACC_TERM_ID)"
1727-
1726+
$uri = "http://localhost:8888/openLink/$($env:ACC_TERM_ID)"
1727+
17281728
try{
17291729
$null = Invoke-RestMethod -Method Post -Uri $uri -Body "{""url"":""$targetLink""}" -ContentType "application/json"
17301730
}catch{
1731-
Write-Warning -Message "Redirecting to $targetLink failed, please open the link in another page."
1731+
Write-Warning -Message "Redirecting to $targetLink failed, please open the link in another page."
17321732
throw
17331733
}
17341734
}
@@ -1765,14 +1765,14 @@ function Get-PackageVersion() {
17651765

17661766
# Apt and some other programs write to stderr, which fails tests without this
17671767
$ErrorActionPreference = "Continue"
1768-
1768+
17691769
# Enumerate all APT packages with versions
17701770
$packages = New-Object -TypeName System.Collections.ArrayList
17711771

17721772
# TODO - find the regular expression to seperate the package name from the package version
1773-
# apt list --installed 2> /dev/null | % {
1773+
# apt list --installed 2> /dev/null | % {
17741774
# Write-Verbose "Apt: $_"
1775-
# if ($_ -match "([^/]*)/[^ ]* ([^ ]*)") {
1775+
# if ($_ -match "([^/]*)/[^ ]* ([^ ]*)") {
17761776
# $p = New-PackageInfo -Name $matches[1] -Version $matches[2] -Type "Apt"
17771777
# $null = $packages.Add($p)
17781778
# }
@@ -1789,7 +1789,7 @@ function Get-PackageVersion() {
17891789
catch {
17901790
return "Error"
17911791
}
1792-
1792+
17931793
$version = ($output | % {
17941794
if ($_ -match $package.match) {
17951795
Write-Verbose "matched $_"
@@ -1806,7 +1806,6 @@ function Get-PackageVersion() {
18061806
@{displayname = "Ansible"; command = "ansible"; args = "--version"; match = "ansible \[core ([\d\.]+)\]"},
18071807
@{displayname = "Istio"; command = "istioctl"; args = "version -s --remote=false"; match = "(.+)"},
18081808
@{displayname = "Go"; command = "go"; args = "version"; match = "go version go(\S+) .*"},
1809-
@{displayname = "Packer"; command = "packer"; args = "version"; match = "Packer v(.+)"},
18101809
@{displayname = "DC/OS CLI"; command = "dcos"; args = "--version"; match = "dcoscli.version=(.*)"},
18111810
@{displayname = "Ripgrep"; command = "rg"; args = "--help | head"; match = "ripgrep ([\d\.]+)$"},
18121811
@{displayname = "Helm"; command = "helm"; args = "version --short"; match = "v(.+)"},
@@ -1826,8 +1825,8 @@ function Get-PackageVersion() {
18261825
}
18271826

18281827
# PIP3 packages
1829-
& pip3 list | % {
1830-
if ($_ -match "(\w+)\s+(.*)") {
1828+
& pip3 list | % {
1829+
if ($_ -match "(\w+)\s+(.*)") {
18311830
$p = New-PackageInfo -Name $matches[1] -Version $matches[2] -Type "PIP"
18321831
$null = $packages.Add($p)
18331832
}

tests/command_list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,6 @@ oomctl
894894
openssl
895895
p11-kit
896896
p11tool
897-
packer
898897
pam_namespace_helper
899898
pam_timestamp_check
900899
parallel

0 commit comments

Comments
 (0)