Skip to content

Commit 18006f8

Browse files
committed
add comments
1 parent 1539757 commit 18006f8

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

dsc_lib/src/configure/config_doc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub enum Operation {
3030
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
3131
pub enum ExecutionKind {
3232
Actual,
33+
// differentiate internally whether what-if should be processed by the resource or dsc engine
3334
#[serde(rename = "WhatIf")]
3435
WhatIfDSC,
3536
#[serde(rename = "WhatIf")]

dsc_lib/src/dscresources/command_resource.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub fn invoke_set(resource: &ResourceManifest, cwd: &str, desired: &str, skip_te
131131
}
132132

133133
if ExecutionKind::WhatIfDSC == *execution_type {
134-
return Err(DscError::NotImplemented("cannot process what-if execution type, resource does not implement what-if or pre-test".to_string()));
134+
return Err(DscError::NotImplemented("cannot process what-if execution type, as resource implements pre-test and does not support what-if".to_string()));
135135
}
136136

137137
let Some(get) = &resource.get else {
@@ -639,7 +639,7 @@ fn process_args(args: &Option<Vec<ArgKind>>, value: &str, execution_type: &Execu
639639
processed_args.push(json_input_arg.clone());
640640
processed_args.push(value.to_string());
641641
},
642-
ArgKind::WhatIf { what_if_input_arg} => {
642+
ArgKind::WhatIf { what_if_input_arg } => {
643643
if execution_type == &ExecutionKind::WhatIfResource {
644644
processed_args.push(what_if_input_arg.clone());
645645
}

dsc_lib/src/dscresources/resource_manifest.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ pub struct SetMethod {
176176
/// Indicates that the resource directly handles `_exist` as a property.
177177
#[serde(rename = "handlesExist", skip_serializing_if = "Option::is_none")]
178178
pub handles_exist: Option<bool>,
179-
/// Indicates that the resource directly handles `what-if` execution type.
180-
#[serde(rename = "handlesWhatIf", skip_serializing_if = "Option::is_none")]
181-
pub handles_what_if: Option<bool>,
182179
/// The type of return value expected from the Set method.
183180
#[serde(rename = "return", skip_serializing_if = "Option::is_none")]
184181
pub returns: Option<ReturnKind>,

tools/dsctest/dscwhatif.dsc.resource.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"whatIfInputArg": "--what-if"
1717
}
1818
],
19-
"implementsPretest": true,
2019
"return": "state"
2120
},
2221
"schema": {

0 commit comments

Comments
 (0)