Skip to content

[WIP] Add metadata from resources #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
handle group example
  • Loading branch information
tgauth committed Jun 26, 2024
commit b9185b3e2b96a3acde22f1d9bf4b48f8a748a2bb
15 changes: 9 additions & 6 deletions dsc_lib/src/configure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ impl Configurator {
fn parse_metadata(set_result: SetResult) -> Result<(SetResult, Option<Value>), DscError> {
match set_result {
SetResult::Resource(mut result) => {
println!("in resource parse_metadata");
if let Value::Object(mut map) = result.after_state.take() {
if let Some(removed_value) = map.remove("_metadata") {
let modified_value = Value::Object(map);
Expand All @@ -697,13 +696,17 @@ impl Configurator {
Ok((set_result_copy, None))
}
} else {
Err(DscError::Operation("Invalid serde value. Expected an object.".to_string()))
let set_result_copy = SetResult::Resource(ResourceSetResponse {
before_state: result.before_state,
after_state: result.after_state,
changed_properties: result.changed_properties
});
Ok((set_result_copy, None))
}
},
SetResult::Group(results) => {
println!("in group parse_metadata");
Ok((SetResult::Group(results.clone()), None))
//Err(DscError::NotImplemented("group resources not implemented yet".to_string()))
SetResult::Group(_results) => {
//Ok((SetResult::Group(results.clone()), None))
Err(DscError::NotImplemented("group resources not implemented yet".to_string()))
}
}
}
Expand Down