Note that this solution is not quite complete yet as it only works for get. However, through this work, I've realized I need to refactor resource get, set, test responses so it is always a list even if just one element. The current separation of a singleton vs list makes it too complicated to complete the work for set and test.
New Microsoft.DSC/Include resource which includes a file for configuration and also parameters
The example include.dsc.yaml shows usage
Needed to add new DSC_TRACE_LEVEL env var so that child dsc processes will emit the same level of traces as I needed it to diagnose problems
if --trace-level is specified, it will replace any existing DSC_TRACE_LEVEL env var with the new value, dsc now uses this env var unless --trace-level is specified
Renamed warning level to warn to match the code to keep it simple
New Import resource kind that needs to support a resolve operation and return a ResolveResult
As part of adding resolve, I've also made get optional since it doesn't make sense for an Import resource
After the files have been resolved to JSON, then a new instance of configurator is created to perform the operation against the resolved content
Needed to change how find_resources() works by internally handling case-insensitivity for searching. This removed a bunch of code that made things lowercase before calling this function.
helper parse_input_to_json() that will accept JSON or YAML and emit JSON since the file pointed to by Include may either be JSON or YAML for the configuration and parameters file
PR Summary
Note that this solution is not quite complete yet as it only works for
get
. However, through this work, I've realized I need to refactor resourceget
,set
,test
responses so it is always a list even if just one element. The current separation of a singleton vs list makes it too complicated to complete the work forset
andtest
.Microsoft.DSC/Include
resource which includes a file for configuration and also parametersinclude.dsc.yaml
shows usageDSC_TRACE_LEVEL
env var so that childdsc
processes will emit the same level of traces as I needed it to diagnose problems--trace-level
is specified, it will replace any existingDSC_TRACE_LEVEL
env var with the new value,dsc
now uses this env var unless--trace-level
is specifiedwarning
level towarn
to match the code to keep it simpleImport
resource kind that needs to support aresolve
operation and return aResolveResult
resolve
, I've also madeget
optional since it doesn't make sense for anImport
resourceconfigurator
is created to perform the operation against the resolved contentfind_resources()
works by internally handling case-insensitivity for searching. This removed a bunch of code that made things lowercase before calling this function.parse_input_to_json()
that will accept JSON or YAML and emit JSON since the file pointed to byInclude
may either be JSON or YAML for the configuration and parameters filePR Context
Fix https://github.com/PowerShell/DSC/issues/412