-
Notifications
You must be signed in to change notification settings - Fork 77
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
The package_exists? method doesn't seem to work. #57
Comments
I just validated same chef and cookbook version works as expected on my vm. I'm simply running:
Do you mind sharing your recipe? Could you try running:
on your node and see if it returns anything? If you are pinning to a version, check that it matches. |
The |
What version of choco? If 0.9.9.9, you should upgrade immediately - we found this issue with it and released a fix in 0.9.9.10 within hours - chocolatey/choco#450 |
In 0.9.9.11 we put in an additional fix for listing pins. |
0.9.9.5... So we need to manually upgrade chocolatey? The cookbook doesn't manage that for us? I see an output like this:
|
I just upgraded to |
Just for posterity the fix (at this time) is to run:
Then the cookbook will start detecting if things are already installed. |
0.9.9.5 should have been doing the right thing. It was less than 0.9.9.2 and 0.9.9.9 that were the known incompatible versions. |
Either way, good to know you were good to go. |
Chocolatey has long been known not to know that chocolatey itself is installed (so it doesn't know about upgrades). This was fixed recently on the website and now is also fixed in choco 0.9.9.9+. |
@ferventcoder Just a suggestion -- add explicit formatting outputs for |
I believe such a ticket exists. |
@docwhat here it is chocolatey/choco#159 |
I'm not quite sure how changing the format is going to resolve the issue. I did a quick spike on outputting xml (because it's built in). This is only like five messages from <event logger="chocolatey.infrastructure.app.services.NugetService" timestamp="2015-11-04T13:59:37.7764193-06:00" level="INFO" thread="10" domain="choco.exe" username="rob">
<message>xunit.assert|2.0.0</message>
<properties>
<data name="log4net:UserName" value="rob" />
<data name="log4net:Identity" value="" />
<data name="log4net:HostName" value="test"/>
</properties>
</event>
<event logger="chocolatey.infrastructure.app.services.NugetService" timestamp="2015-11-04T13:59:37.7920227-06:00" level="INFO" thread="10" domain="choco.exe" username="rob">
<message>xunit.core|2.0.0</message>
<properties>
<data name="log4net:UserName" value="rob" />
<data name="log4net:Identity" value="" />
<data name="log4net:HostName" value="test" />
</properties>
</event>
<event logger="chocolatey.infrastructure.app.services.NugetService" timestamp="2015-11-04T13:59:37.7920227-06:00" level="INFO" thread="10" domain="choco.exe" username="rob">
<message>xunit.extensibility.core|2.0.0</message>
<properties>
<data name="log4net:UserName" value="rob" />
<data name="log4net:Identity" value="" />
<data name="log4net:HostName" value="test" />
</properties>
</event>
<event logger="chocolatey.infrastructure.app.services.NugetService" timestamp="2015-11-04T13:59:37.7920227-06:00" level="INFO" thread="10" domain="choco.exe" username="rob">
<message>xunit.runner.console|2.0.0</message>
<properties>
<data name="log4net:UserName" value="rob" />
<data name="log4net:Identity" value="" />
<data name="log4net:HostName" value="test" />
</properties>
</event>
<event logger="chocolatey" timestamp="2015-11-04T13:59:37.7920227-06:00" level="INFO" thread="10" domain="choco.exe" username="rob">
<message>Exiting with 0</message>
<properties>
<data name="log4net:UserName" value="rob" />
<data name="log4net:Identity" value="" />
<data name="log4net:HostName" value="test" />
</properties>
</event> Other than simply changing the output to json or xml, it doesn't seem like it will solve the issue in a way that you might like to see, which is more about breaking down the data as it comes out. That is a lot more involved and is not something we are currently exploring. |
The idea I had is that unlike the normal output, designed for humans, the XML or JSON output would be pre parsed and easy for a script to consume. It's the difference between Git's porcelain and CLI stuff. The format for programs to consume won't break backwards compatibility, but the human interface can change as desired. But I'm not a powershell person, so maybe objects solve this? |
@docwhat And that is where chocolatey.lib comes in. |
Chef: 12.4.3
Cookbook: 0.4.1
The
package_exists?
method doesn't seem to work. I don't see the INFO message "blah already installed - nothing to do." and I always see theexecute
being run.This is problematic because I have reboot handlers for certain packages and with the
package_exists?
being broken, it is causing a reboot every run.The text was updated successfully, but these errors were encountered: