Skip to content

Commit ac77397

Browse files
authored
Merge pull request #1029 from SteveL-MSFT/dupe-error
Add type name to duplicate resource error message
2 parents 2482bbd + d01d0b2 commit ac77397

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dsc/tests/dsc_config_test.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ Describe 'dsc config test tests' {
8383
$null = dsc config test -i $configYaml 2> "$TestDrive/trace.log"
8484
$LASTEXITCODE | Should -Be 2
8585
$log = Get-Content "$TestDrive/trace.log" -Raw
86-
$log | Should -Match ".*Resource named 'MyTest' is specified more than once.*" -Because ($log | Out-String)
86+
$log | Should -Match ".*Resource named 'MyTest' for type 'Microsoft.DSC.Debug/Echo' is specified more than once.*" -Because ($log | Out-String)
8787
}
8888
}

dsc_lib/locales/en-us.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ notAllowedValue = "Parameter '%{name}' has allowed values constraint but is not
2626
allowedValuesNotStringOrInteger = "Parameter '%{name}' has allowed values constraint but is not a string or integer"
2727

2828
[configure.dependsOn]
29-
duplicateResource = "Resource named '%{name}' is specified more than once in the configuration"
29+
duplicateResource = "Resource named '%{name}' for type '%{type_name}' is specified more than once in the configuration"
3030
syntaxIncorrect = "'dependsOn' syntax is incorrect: %{dependency}"
3131
dependencyNotFound = "'dependsOn' resource name '%{dependency_name}' does not exist for resource named '%{resource_name}'"
3232
dependencyTypeMismatch = "'dependsOn' resource type '%{resource_type}' does not match resource type '%{dependency_type}' for resource named '%{resource_name}'"

dsc_lib/src/configure/depends_on.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn get_resource_invocation_order(config: &Configuration, parser: &mut Statem
2929
for resource in &config.resources {
3030
// validate that the resource isn't specified more than once in the config
3131
if config.resources.iter().filter(|r| r.name == resource.name && r.resource_type == resource.resource_type).count() > 1 {
32-
return Err(DscError::Validation(t!("configure.dependsOn.duplicateResource", name = resource.name).to_string()));
32+
return Err(DscError::Validation(t!("configure.dependsOn.duplicateResource", name = resource.name, type_name = resource.resource_type).to_string()));
3333
}
3434

3535
let mut dependency_already_in_order = true;

0 commit comments

Comments
 (0)