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

invalid version detection in install_command.ps1 #16

Closed
hh opened this issue Oct 14, 2015 · 5 comments
Closed

invalid version detection in install_command.ps1 #16

hh opened this issue Oct 14, 2015 · 5 comments

Comments

@hh
Copy link

hh commented Oct 14, 2015

As a chef-provisioning user
When I set chef_version in convergence_options to 12.5.1
Then I expect a node with 12.4.1 installed to upgraded to 12.5.1.

(If this needs to be a chef-provisioning ticket, let me know)

Suspecting something around

if ($chef_version.StartsWith($version)) { return $false }

               convergence_options: {
                 chef_version: '12.5.1'
               },
    - write file C:\chef\client.rb on base-2012-hardened-xviii
    - write file C:\chef\install.ps1 on base-2012-hardened-xviii
    [base-2012-hardened-xviii] Method invocation failed because [Selected.System.String] does not contain a 
                               method named 'StartsWith'.
    [base-2012-hardened-xviii] -----> Chef Omnibus installation detected (12.5.1)

    [base-2012-hardened-xviii] At C:\chef\install.ps1:19 char:7
                               +   if ($chef_version.StartsWith($version)) { return $false }
                               +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                   + CategoryInfo          : InvalidOperation: (StartsWith:String) [], Runtim 
                                  eException
                                   + FullyQualifiedErrorId : MethodNotFound

    - run 'powershell.exe -ExecutionPolicy Unrestricted -NoProfile "& ""C:\chef\install.ps1"""' on base-2012-hardened-xviii[2015-10-14T09:46:01-04:00] INFO: Processing chef_node[base-2012-hardened-xviii] action create (basic_chef_client::block line 57)
[2015-10-14T09:46:02-04:00] INFO: Converging base-2012-hardened-xviii because the resource was updated ...

    [base-2012-hardened-xviii] [2015-10-14T13:46:18+00:00] INFO: *** Chef 12.4.1 ***
@thommay
Copy link
Contributor

thommay commented Oct 26, 2015

@jaym @smurawski can y'all have a look at this? I lifted the powershell code from kitchen I think.

@jaym
Copy link
Contributor

jaym commented Oct 26, 2015

may be related to test-kitchen/test-kitchen#864

dissonanz added a commit to dissonanz/mixlib-install that referenced this issue Oct 26, 2015
@dissonanz
Copy link

Yes it's the same. I had to refactor the split in order to stay within the command size limit, but this seems to work.

dissonanz added a commit to dissonanz/mixlib-install that referenced this issue Oct 26, 2015
@schisamo
Copy link
Contributor

schisamo commented Nov 3, 2015

Fix is in #21

@wrightp
Copy link

wrightp commented Jan 19, 2016

Fixed in mixlib-install 0.7.1

@wrightp wrightp closed this as completed Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants