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

Puppet 5 is released. Make case statement future proof #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ fi

# Only puppet 3.2.1 - 3.8 support "--parser future" option.
case $(puppet --version) in
4*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
3.[2-8]*) USE_PUPPET_FUTURE_PARSER="enabled" ;;
Copy link

@pillarsdotnet pillarsdotnet Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-# Only puppet 3.2.1 - 3.8 support "--parser future" option.
+# Only puppet 3.1.1 - 3.8.7 support "--parser future" option.
 case $(puppet --version) in
-  4*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
+  3.1.[1-9]*) ;&
+  3.[2-8]*) USE_PUPPET_FUTURE_PARSER="enabled" ;;
+  *) USE_PUPPET_FUTURE_PARSER="disabled" ;;
 esac

The "--parser=future" command-line setting was added in version 3.1.1 (See lib/puppet/version.rb and lib/puppet/defaults.rb).

*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
esac

SAVEIFS=$IFS
Expand Down