Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dsc/tests/dsc_config_test.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion dsc_lib/locales/en-us.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}'"
Expand Down
2 changes: 1 addition & 1 deletion dsc_lib/src/configure/depends_on.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading