@@ -588,24 +588,24 @@ pub fn validate_properties(resource: &DscResource, properties: &Value) -> Result
588588 // convert to resource_manifest``
589589 let manifest: ResourceManifest = serde_json:: from_value ( manifest) ?;
590590 if manifest. validate . is_some ( ) {
591- debug ! ( "{}: {type_name} " , t!( "subcommand .resourceImplementsValidate" ) ) ;
591+ debug ! ( "{}: {type_name} " , t!( "dscresources.dscresource .resourceImplementsValidate" ) ) ;
592592 let resource_config = properties. to_string ( ) ;
593593 let result = resource. validate ( & resource_config) ?;
594594 if !result. valid {
595- let reason = result. reason . unwrap_or ( t ! ( "subcommand .noReason" ) . to_string ( ) ) ;
596- return Err ( DscError :: Validation ( format ! ( "{}: {type_name} {reason}" , t!( "subcommand .resourceValidationFailed" ) ) ) ) ;
595+ let reason = result. reason . unwrap_or ( t ! ( "dscresources.dscresource .noReason" ) . to_string ( ) ) ;
596+ return Err ( DscError :: Validation ( format ! ( "{}: {type_name} {reason}" , t!( "dscresources.dscresource .resourceValidationFailed" ) ) ) ) ;
597597 }
598598 return Ok ( ( ) )
599599 }
600600 // use schema validation
601- trace ! ( "{}: {type_name}" , t!( "subcommand .resourceDoesNotImplementValidate" ) ) ;
601+ trace ! ( "{}: {type_name}" , t!( "dscresources.dscresource .resourceDoesNotImplementValidate" ) ) ;
602602 let Ok ( schema) = resource. schema ( ) else {
603- return Err ( DscError :: Validation ( format ! ( "{}: {type_name}" , t!( "subcommand .noSchemaOrValidate" ) ) ) ) ;
603+ return Err ( DscError :: Validation ( format ! ( "{}: {type_name}" , t!( "dscresources.dscresource .noSchemaOrValidate" ) ) ) ) ;
604604 } ;
605605 let schema = serde_json:: from_str ( & schema) ?;
606606 return validate_json ( & resource. type_name , & schema, properties)
607607 }
608- Err ( DscError :: Validation ( format ! ( "{}: {type_name}" , t!( "subcommand .noManifest" ) ) ) )
608+ Err ( DscError :: Validation ( format ! ( "{}: {type_name}" , t!( "dscresources.dscresource .noManifest" ) ) ) )
609609}
610610
611611/// Validate the JSON against the schema.
@@ -624,18 +624,18 @@ pub fn validate_properties(resource: &DscResource, properties: &Value) -> Result
624624///
625625/// * `DscError` - The JSON is invalid
626626pub fn validate_json ( source : & str , schema : & Value , json : & Value ) -> Result < ( ) , DscError > {
627- debug ! ( "{}: {source}" , t!( "util .validatingSchema" ) ) ;
627+ debug ! ( "{}: {source}" , t!( "dscresources.dscresource .validatingSchema" ) ) ;
628628 trace ! ( "JSON: {json}" ) ;
629629 trace ! ( "Schema: {schema}" ) ;
630630 let compiled_schema = match Validator :: new ( schema) {
631631 Ok ( compiled_schema) => compiled_schema,
632632 Err ( err) => {
633- return Err ( DscError :: Validation ( format ! ( "{}: {err}" , t!( "util .failedToCompileSchema" ) ) ) ) ;
633+ return Err ( DscError :: Validation ( format ! ( "{}: {err}" , t!( "dscresources.dscresource .failedToCompileSchema" ) ) ) ) ;
634634 }
635635 } ;
636636
637637 if let Err ( err) = compiled_schema. validate ( json) {
638- return Err ( DscError :: Validation ( format ! ( "{}: '{source}' {err}" , t!( "util .validationFailed" ) ) ) ) ;
638+ return Err ( DscError :: Validation ( format ! ( "{}: '{source}' {err}" , t!( "dscresources.dscresource .validationFailed" ) ) ) ) ;
639639 }
640640
641641 Ok ( ( ) )
0 commit comments