Fixes repository install from fileshare

This commit is contained in:
Lord Hepipud 2021-09-09 11:44:00 +02:00
parent 068958d79a
commit 8a5995603a
4 changed files with 10 additions and 3 deletions

View file

@ -14,6 +14,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
### Bugfixes
* [#361](https://github.com/Icinga/icinga-powershell-framework/issues/361) Fixes IMC freeze on Icinga Director Self-Service installation, in case no Agent installation set on Self-Service API config
* [#362](https://github.com/Icinga/icinga-powershell-framework/issues/362) Fixes repository component installation from file share locations
## 1.6.0 (2021-09-07)

View file

@ -24,8 +24,8 @@ function Read-IcingaRepositoryFile()
$RepoPath = $Repository.LocalPath;
$Content = Get-Content -Path (Join-Path -Path $RepoPath -ChildPath 'ifw.repo.json') -Raw;
} elseif ([string]::IsNullOrEmpty($Repository.RemotePath) -eq $FALSE -And (Test-Path -Path $Repository.RemotePath)) {
$RepoPath = $Repository.RemotePath;
$WebContent = Get-Content -Path (Join-Path -Path $RepoPath -ChildPath 'ifw.repo.json') -Raw;
$RepoPath = $Repository.RemotePath;
$Content = Get-Content -Path (Join-Path -Path $RepoPath -ChildPath 'ifw.repo.json') -Raw;
} else {
try {
$RepoPath = $Repository.RemotePath;

View file

@ -31,7 +31,7 @@ function Search-IcingaRepository()
$SearchList | Add-Member -MemberType NoteProperty -Name 'Repos' -Value @();
foreach ($entry in $Repositories) {
$RepoContent = Read-IcingaRepositoryFile -Name $entry.Name;
$RepoContent = Read-IcingaRepositoryFile -Name $entry.Name;
if ($null -eq $RepoContent) {
continue;

View file

@ -77,6 +77,12 @@ function Invoke-IcingaWebRequest()
$Index++;
}
# If our URI is a local path or a file share path, always ensure to use the correct Windows directory
# handling with '\' instead of '/'
if ([string]::IsNullOrEmpty($Uri) -eq $FALSE -And (Test-Path $Uri)) {
$Uri = $Uri.Replace('/', '\');
}
$WebArguments = @{
'Uri' = $Uri;
'Method' = $Method;