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

platform_detection.sh incorrectly parses /etc/system-release on Amazon Linux 2017.12 LTS Release Candidate #252

Closed
EdouardMYOB opened this issue Mar 6, 2018 · 4 comments
Assignees

Comments

@EdouardMYOB
Copy link

EdouardMYOB commented Mar 6, 2018

elif test -f "/etc/system-release"; then
  platform=`sed 's/^\(.\+\) release.\+/\1/' /etc/system-release | tr '[A-Z]' '[a-z]'`
  platform_version=`sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/system-release | tr '[A-Z]' '[a-z]'`
  # amazon is built off of fedora, so act like RHEL
  if test "$platform" = "amazon linux ami"; then
    # FIXME: remove client side platform_version mangling and hard coded yolo, and remapping to deprecated "el"
    platform="el"
    platform_version="6.0"
  fi

is looking for a match "amazon linux ami", but on Amazon Linux 2017.12 LTS Release Candidate /etc/system-release contains "Amazon Linux release 2.0 (2017.12) LTS Release Candidate", so the platform sed command returns "amazon linux", and the code falls through rather than matching.

This ends up with platform_detection.sh returning "amazon linux 2.0 x86_64" instead of "el 6 x86_64", and things that rely on the output thinking that the architecture is "2.0", not "x86_64"

@wrightp
Copy link

wrightp commented Jul 10, 2018

Was this fixed as part of #262?

@tas50
Copy link
Contributor

tas50 commented Jul 10, 2018

That should also be fixed by #262

@tas50 tas50 closed this as completed Jul 10, 2018
@wrightp
Copy link

wrightp commented Jul 12, 2018

Reopening this ticket. This change caused a regression exposed by chef-ingredient. chef-cookbooks/chef-ingredient#228 . Self-assigning.

@wrightp wrightp reopened this Jul 12, 2018
@wrightp wrightp self-assigned this Jul 12, 2018
@wrightp
Copy link

wrightp commented Jul 24, 2018

This code example is old. If this issue is still occurring with the latest version we can create a new issue.

@wrightp wrightp closed this as completed Jul 24, 2018
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

3 participants