-
Notifications
You must be signed in to change notification settings - Fork 68
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
(MODULES-3037) Manage sources #1
(MODULES-3037) Manage sources #1
Conversation
bf02558
to
c00496f
Compare
c00496f
to
9b0f33f
Compare
d4ef65d
to
00a0d0e
Compare
dd56022
to
1a83680
Compare
Add .vscode.
Add testing information to the examples manifest.
1a83680
to
3ca0c2e
Compare
| describe 'Chocolatey Common' do | ||
|
|
||
| context 'on Windows', :if => Puppet::Util::Platform.windows? do | ||
|
|
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.
This is empty right now, but I wanted to get eyes on this so we can get it merged and through soon. So we can pick this up in other tickets or as maint.
3ca0c2e
to
a9f159a
Compare
|
@puppetlabs/windows please review. |
10e5f8f
to
187c92c
Compare
| if Puppet::Util::Platform.windows? | ||
| chocoInstallPath = PuppetX::Chocolatey::ChocolateyInstall.install_path | ||
| #default_location = $::choco_installpath || ENV['ALLUSERSPROFILE'] + '\chocolatey' | ||
| chocopath = ('C:\ProgramData\chocolatey' if file_exists?('C:\ProgramData\chocolatey\bin\choco.exe')) || |
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.
I'm not 100% comfortable with using a hardcoded path for C:\ProgramData. It tends to be surfaced as %ALLUSERSPROFILE% or at least %SYSTEMDRIVE%\ProgramData
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.
This section is a straight copy from the package provider. There be voodo and reasons there, they haven't been all determined yet.
|
Is it worth refactoring out the "magic" version numbers in the unit tests e.g. 0.9.9.10 etc? |
Yeah, I think we should make it clearer - I'll change it to minimum_supported_version - that should make it pretty clear what is being tested. |
187c92c
to
8a97145
Compare
|
|
||
| context 'on Linux', :if => Puppet.features.posix? do | ||
| it "should return the default install path on a non-windows system" do | ||
| PuppetX::Chocolatey::ChocolateyInstall.install_path.must == 'C:\ProgramData\chocolatey' |
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.
This seems counter-intuitive. On a linux system wouldn't the install path be nil or empty?
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.
Default path when one is not found.
382550d
to
1ff4c3e
Compare
|
@puppetlabs/windows paired with @glennsarti some today on this as we fought through refactoring the Chocolatey package provider bits to get them to use There may be an underlying issue or two with when choco.exe is actually found (every system that runs these tests has Chocolatey installed). We removed it for a bit to ensure things would work without it. |
|
|
- Move chocolatey_spec to spec/unit/puppet/provider/package - Add tests around `PuppetX::ChocolateyInstall`. - Lean out tests for `choco_install_path` Fact since it calls `PuppetX::ChocolateyInstall `.
1ff4c3e
to
28bd939
Compare
Move the bits for the fact `chocolateyversion` to `PuppetX::Chocolatey::ChocolateyVersion`. Move the tests around and update appropriately as well. Also when working against 0.9.8.33, handle the warning message that is shown to users before the version message.
If a registry check does not turn up results, ChocolateyInstall should fall back to looking at process/user environment variable to determine if the environment variable `ChocolateyInstall` is defined.
When working with Chocolatey, there are common calls that are necessary to complete operations using choco. Create that as a PuppetX module to be used by providers.
The package provider for Chocolatey should use the ChocolateyCommon methods instead of maintaining its own version of those methods. Refactor it to use those instead.
Provide the ability manage a source with a custom type and provider. This allows a source to be ensurable, and also allows for a source to be manageable in the same converge that Chocolatey is installed during. This further allows for installing packages from custom sources all in the same Puppet run.
28bd939
to
086cb40
Compare
|
@puppetlabs/windows all comments have been addressed. Ready to go. |
|
Looks good to me. |
Provide the ability manage a source with a custom type and provider.
This allows a source to be ensurable, and also allows for a source to
be manageable in the same converge that Chocolatey is installed
during. This further allows for installing packages from custom
sources all in the same Puppet run.