-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use common module DscResource.Common #453
Use common module DscResource.Common #453
Conversation
e10d450
to
a3c522a
Compare
@PlagueHO this one is ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great @johlju ! Just some minor tweaks. I'll replicate into other repos when I have a change (have created issues to track).
Reviewed 37 of 37 files at r1.
Reviewable status: all files reviewed, 27 unresolved discussions (waiting on @johlju)
source/DSCResources/DSC_DefaultGatewayAddress/DSC_DefaultGatewayAddress.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
Can you use the $modulePath
variable defined above?
Also, is there a need to use a script scoped variable here?
Finally, you could just use the same code pattern as the line above:
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'DscResource.Common'))
source/DSCResources/DSC_DnsClientGlobalSetting/DSC_DnsClientGlobalSetting.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_DnsConnectionSuffix/DSC_DnsConnectionSuffix.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_DnsServerAddress/DSC_DnsServerAddress.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_Firewall/DSC_Firewall.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_FirewallProfile/DSC_FirewallProfile.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_IPAddress/DSC_IPAddress.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_IPAddressOption/DSC_IPAddressOption.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterAdvancedProperty/DSC_NetAdapterAdvancedProperty.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterBinding/DSC_NetAdapterBinding.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterLso/DSC_NetAdapterLso.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterName/DSC_NetAdapterName.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterRdma/DSC_NetAdapterRdma.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterRsc/DSC_NetAdapterRsc.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterRss/DSC_NetAdapterRss.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetAdapterState/DSC_NetAdapterState.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetBios/DSC_NetBios.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetConnectionProfile/DSC_NetConnectionProfile.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetIPInterface/DSC_NetIPInterface.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetworkTeam/DSC_NetworkTeam.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_NetworkTeamInterface/DSC_NetworkTeamInterface.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_ProxySettings/DSC_ProxySettings.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_Route/DSC_Route.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_WaitForNetworkTeam/DSC_WaitForNetworkTeam.psm1, line 13 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_WinsServerAddress/DSC_WinsServerAddress.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
source/DSCResources/DSC_WinsSetting/DSC_WinsSetting.psm1, line 8 at r1 (raw file):
-ChildPath 'NetworkingDsc.Common.psm1')) $script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'
See previous comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 9 of 37 files reviewed, 27 unresolved discussions (waiting on @PlagueHO)
source/DSCResources/DSC_DefaultGatewayAddress/DSC_DefaultGatewayAddress.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Can you use the
$modulePath
variable defined above?Also, is there a need to use a script scoped variable here?
Finally, you could just use the same code pattern as the line above:
Import-Module -Name (Join-Path -Path $modulePath ` -ChildPath (Join-Path -Path 'DscResource.Common'))
Done.
source/DSCResources/DSC_DnsClientGlobalSetting/DSC_DnsClientGlobalSetting.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_DnsConnectionSuffix/DSC_DnsConnectionSuffix.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_DnsServerAddress/DSC_DnsServerAddress.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_Firewall/DSC_Firewall.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_FirewallProfile/DSC_FirewallProfile.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_IPAddress/DSC_IPAddress.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_IPAddressOption/DSC_IPAddressOption.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterAdvancedProperty/DSC_NetAdapterAdvancedProperty.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterBinding/DSC_NetAdapterBinding.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterLso/DSC_NetAdapterLso.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterName/DSC_NetAdapterName.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterRdma/DSC_NetAdapterRdma.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterRsc/DSC_NetAdapterRsc.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterRss/DSC_NetAdapterRss.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetAdapterState/DSC_NetAdapterState.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetBios/DSC_NetBios.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetConnectionProfile/DSC_NetConnectionProfile.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetIPInterface/DSC_NetIPInterface.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetworkTeam/DSC_NetworkTeam.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_NetworkTeamInterface/DSC_NetworkTeamInterface.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_ProxySettings/DSC_ProxySettings.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_Route/DSC_Route.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_WaitForNetworkTeam/DSC_WaitForNetworkTeam.psm1, line 13 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_WinsServerAddress/DSC_WinsServerAddress.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
source/DSCResources/DSC_WinsSetting/DSC_WinsSetting.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
See previous comments.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 9 of 37 files reviewed, 27 unresolved discussions (waiting on @johlju and @PlagueHO)
source/DSCResources/DSC_DefaultGatewayAddress/DSC_DefaultGatewayAddress.psm1, line 8 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Done.
Sorry @johlju - I didn't check my example (just freehanded into comment). It should be:
Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common')
This is causing the tests to fail. Sorry about that - my bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 9 of 37 files reviewed, 27 unresolved discussions (waiting on @PlagueHO)
source/DSCResources/DSC_DefaultGatewayAddress/DSC_DefaultGatewayAddress.psm1, line 8 at r1 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Sorry @johlju - I didn't check my example (just freehanded into comment). It should be:
Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common')This is causing the tests to fail. Sorry about that - my bad.
Not your fault 😄 I was sitting in front of the TV and just did a search and replace, and didn't even read the code, I just assumed it was correct. 😉 Then pushed and forgot to look at the status checks because was working with stuff in SqlServerDsc at the same time. 🙂
Hopefully it passes now. I will keep an eye on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to wait for the tests to pass. It looks like they failed because of a problem creating the loopback adapters on the agent.... a bit strange.
Reviewed 28 of 28 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Pull Request (PR) description
This Pull Request (PR) fixes the following issues
None.
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is