Skip to content
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

Renamed field that specifies adapted type #482

Merged
merged 9 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub fn add_fields_to_json(json: &str, fields_to_add: &HashMap<String, String>) -
pub fn add_type_name_to_json(json: String, type_name: String) -> String
{
let mut map:HashMap<String,String> = HashMap::new();
map.insert(String::from("type"), type_name);
map.insert(String::from("adapted_dsc_type"), type_name);

let mut j = json;
if j.is_empty()
Expand Down
7 changes: 2 additions & 5 deletions powershell-adapter/psDscAdapter/psDscAdapter.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ function Get-DscResourceObject {
}
else {
# mimic a config object with a single resource
$type = $inputObj.type
$inputObj.psobject.properties.Remove('type')
$type = $inputObj.adapted_dsc_type
$inputObj.psobject.properties.Remove('adapted_dsc_type')
$desiredState += [dscResourceObject]@{
name = $adapterName
type = $type
Expand Down Expand Up @@ -408,9 +408,6 @@ function Invoke-DscOperation {
$psVersion = $PSVersionTable.PSVersion.ToString()
'PowerShell version: ' + $psVersion | Write-DscTrace

$moduleVersion = Get-Module PSDesiredStateConfiguration | ForEach-Object Version
'PSDesiredStateConfiguration module version: ' + $moduleVersion | Write-DscTrace

# get details from cache about the DSC resource, if it exists
$cachedDscResourceInfo = $dscResourceCache | Where-Object Type -EQ $DesiredState.type | ForEach-Object DscResourceInfo

Expand Down
4 changes: 2 additions & 2 deletions powershell-adapter/psDscAdapter/win_psDscAdapter.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ function Get-DscResourceObject {
}
else {
# mimic a config object with a single resource
$type = $inputObj.type
$inputObj.psobject.properties.Remove('type')
$type = $inputObj.adapted_dsc_type
$inputObj.psobject.properties.Remove('adapted_dsc_type')
$desiredState += [dscResourceObject]@{
name = $adapterName
type = $type
Expand Down
2 changes: 1 addition & 1 deletion wmi-adapter/wmi.resource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ elseif ($Operation -eq 'Get')
}
else # we are processing an individual resource call
{
$type_fields = $inputobj_pscustomobj.type -split "/"
$type_fields = $inputobj_pscustomobj.adapted_dsc_type -split "/"
$wmi_namespace = $type_fields[0].Replace('.','\')
$wmi_classname = $type_fields[1]

Expand Down
Loading