Skip to content

Commit cace460

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
Fix trace message to not have the path twice since it's in the nested error
1 parent 7af2311 commit cace460

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

dsc/tests/dsc_discovery.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ Describe 'tests for resource discovery' {
364364
$LASTEXITCODE | Should -Be 0
365365
$out | Should -BeNullOrEmpty -Because (Get-Content -Raw -Path "$testdrive/error.txt")
366366
$errorLog = Get-Content -Raw -Path "$testdrive/error.txt"
367-
$errorLog | Should -Match "INFO Failed to load manifest '.*test.dsc.resource.json':" -Because $errorLog
367+
$errorLog | Should -BeLike "*INFO Failed to load manifest: Invalid manifest for resource '*test.dsc.resource.json'*" -Because $errorLog
368368
} finally {
369369
$env:DSC_RESOURCE_PATH = $null
370370
}

dsc/tests/dsc_extension_discover.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Describe 'Discover extension tests' {
199199
foreach ($resource in $out) {
200200
$resource.type | Should -Not -Be 'Test/InvalidManifest'
201201
}
202-
(Get-Content -Path "$TestDrive/error.log" -Raw) | Should -BeLike "*Extension 'Test/DiscoverInvalid' failed to load manifest '*invalidManifest.dsc.resource.json':*" -Because (Get-Content -Path "$TestDrive/error.log" -Raw | Out-String)
202+
(Get-Content -Path "$TestDrive/error.log" -Raw) | Should -BeLike "*INFO Extension 'Test/DiscoverInvalid' failed to load manifest: Invalid manifest for resource '*invalidManifest.dsc.resource.json'*" -Because (Get-Content -Path "$TestDrive/error.log" -Raw | Out-String)
203203
} finally {
204204
$env:DSC_RESOURCE_PATH = $null
205205
$env:TestDrive = $null

lib/dsc-lib/locales/en-us.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ conditionNotBoolean = "Condition '%{condition}' did not evaluate to a boolean"
140140
conditionNotMet = "Condition '%{condition}' not met, skipping manifest at '%{path}' for resource '%{resource}'"
141141
adaptedResourcePathNotFound = "Adapted resource '%{resource}' path not found: %{path}"
142142
invalidManifestFileName = "Invalid manifest file name '%{path}'"
143-
failedLoadManifest = "Failed to load manifest '%{path}': %{err}"
143+
failedLoadManifest = "Failed to load manifest: %{err}"
144144

145145
[dscresources.commandResource]
146146
invokeGet = "Invoking get for '%{resource}'"
@@ -253,7 +253,7 @@ importNoResults = "Extension '%{extension}' returned no results for import"
253253
secretMultipleLinesReturned = "Extension '%{extension}' returned multiple lines which is not supported for secrets"
254254
importProcessingOutput = "Processing output from extension '%{extension}'"
255255
deprecationMessage = "Extension '%{extension}' is deprecated: %{message}"
256-
failedLoadManifest = "Extension '%{extension}' failed to load manifest '%{path}': %{err}"
256+
failedLoadManifest = "Extension '%{extension}' failed to load manifest: %{err}"
257257

258258
[extensions.extension_manifest]
259259
extensionManifestSchemaTitle = "Extension manifest schema URI"

lib/dsc-lib/src/discovery/command_discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl ResourceDiscovery for CommandDiscovery {
278278
// resource that is requested by resource/config operation
279279
// if it is, then "ResouceNotFound" error will be issued later
280280
// and here we just write as info
281-
info!("{}", t!("discovery.commandDiscovery.failedLoadManifest", path = path.to_string_lossy(), err = e));
281+
info!("{}", t!("discovery.commandDiscovery.failedLoadManifest", err = e));
282282
continue;
283283
},
284284
};

lib/dsc-lib/src/extensions/discover.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl DscExtension {
102102
let manifests = match load_manifest(&discover_result.manifest_path) {
103103
Ok(manifests) => manifests,
104104
Err(err) => {
105-
info!("{}", t!("extensions.dscextension.failedLoadManifest", extension = self.type_name, path = discover_result.manifest_path.to_string_lossy(), err = err));
105+
info!("{}", t!("extensions.dscextension.failedLoadManifest", extension = self.type_name, err = err));
106106
continue;
107107
}
108108
};

0 commit comments

Comments
 (0)