diff --git a/dsc/tests/dsc_config_test.tests.ps1 b/dsc/tests/dsc_config_test.tests.ps1 index 4a7220b08..f80b416c5 100644 --- a/dsc/tests/dsc_config_test.tests.ps1 +++ b/dsc/tests/dsc_config_test.tests.ps1 @@ -83,6 +83,6 @@ Describe 'dsc config test tests' { $null = dsc config test -i $configYaml 2> "$TestDrive/trace.log" $LASTEXITCODE | Should -Be 2 $log = Get-Content "$TestDrive/trace.log" -Raw - $log | Should -Match ".*Resource named 'MyTest' is specified more than once.*" -Because ($log | Out-String) + $log | Should -Match ".*Resource named 'MyTest' for type 'Microsoft.DSC.Debug/Echo' is specified more than once.*" -Because ($log | Out-String) } } diff --git a/dsc_lib/locales/en-us.toml b/dsc_lib/locales/en-us.toml index d0a11e736..8fac0f5b6 100644 --- a/dsc_lib/locales/en-us.toml +++ b/dsc_lib/locales/en-us.toml @@ -26,7 +26,7 @@ notAllowedValue = "Parameter '%{name}' has allowed values constraint but is not allowedValuesNotStringOrInteger = "Parameter '%{name}' has allowed values constraint but is not a string or integer" [configure.dependsOn] -duplicateResource = "Resource named '%{name}' is specified more than once in the configuration" +duplicateResource = "Resource named '%{name}' for type '%{type_name}' is specified more than once in the configuration" syntaxIncorrect = "'dependsOn' syntax is incorrect: %{dependency}" dependencyNotFound = "'dependsOn' resource name '%{dependency_name}' does not exist for resource named '%{resource_name}'" dependencyTypeMismatch = "'dependsOn' resource type '%{resource_type}' does not match resource type '%{dependency_type}' for resource named '%{resource_name}'" diff --git a/dsc_lib/src/configure/depends_on.rs b/dsc_lib/src/configure/depends_on.rs index 684894d70..3e7a16a9f 100644 --- a/dsc_lib/src/configure/depends_on.rs +++ b/dsc_lib/src/configure/depends_on.rs @@ -29,7 +29,7 @@ pub fn get_resource_invocation_order(config: &Configuration, parser: &mut Statem for resource in &config.resources { // validate that the resource isn't specified more than once in the config if config.resources.iter().filter(|r| r.name == resource.name && r.resource_type == resource.resource_type).count() > 1 { - return Err(DscError::Validation(t!("configure.dependsOn.duplicateResource", name = resource.name).to_string())); + return Err(DscError::Validation(t!("configure.dependsOn.duplicateResource", name = resource.name, type_name = resource.resource_type).to_string())); } let mut dependency_already_in_order = true;