(input_kind: Option<&InputKind>, input: &str)
| 1064 | } |
| 1065 | |
| 1066 | fn get_command_input(input_kind: Option<&InputKind>, input: &str) -> Result<CommandInput, DscError> { |
| 1067 | let mut env: Option<HashMap<String, String>> = None; |
| 1068 | let mut stdin: Option<String> = None; |
| 1069 | match input_kind { |
| 1070 | Some(InputKind::Env) => { |
| 1071 | debug!("{}", t!("dscresources.commandResource.parseAsEnvVars")); |
| 1072 | env = Some(json_to_hashmap(input)?); |
| 1073 | }, |
| 1074 | Some(InputKind::Stdin) => { |
| 1075 | debug!("{}", t!("dscresources.commandResource.parseAsStdin")); |
| 1076 | stdin = Some(input.to_string()); |
| 1077 | }, |
| 1078 | None => { |
| 1079 | debug!("{}", t!("dscresources.commandResource.noInput")); |
| 1080 | // leave input as none |
| 1081 | }, |
| 1082 | } |
| 1083 | |
| 1084 | Ok(CommandInput { |
| 1085 | env, |
| 1086 | stdin, |
| 1087 | }) |
| 1088 | } |
| 1089 | |
| 1090 | fn verify_json_from_manifest(resource: &DscResource, json: &str, target_resource: Option<&DscResource>) -> Result<(), DscError> { |
| 1091 | trace!("{}", t!("dscresources.commandResource.verifyJson", resource = resource.type_name, json = json)); |
no test coverage detected