This is an automated email from the ASF dual-hosted git repository.

sekikn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git

commit 42ec95088845c143f07e8047e8d9cbdaf3731c58
Author: Guodong Xu <[email protected]>
AuthorDate: Tue May 15 20:08:28 2018 +0800

    BIGTOP-3029: --parser is invalidated in puppet v4.x
    
    Starting from puppet 4.x, --parse is not a valid option for puppet any more.
    This results in when running in pre-built image
    bigtop/slaves:trunk-debian-9-aarch64 and :trunk-debian-9, we see this error:
    
    $ sudo docker run -it --rm --workdir /ws  -v `pwd`:/ws 
bigtop/slaves:trunk-debian-9-aarch64 bash -l
    
    root@b40443df7cce:/ws# ./gradlew toolchain
    Error: Could not parse application options: invalid option: --parser
    
    This patch adds puppet version check in task toolchain. "--parser future" is
    added into command only in puppet version 3.x
    
    Signed-off-by: Guodong Xu <[email protected]>
    Signed-off-by: Kengo Seki <[email protected]>
---
 build.gradle | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/build.gradle b/build.gradle
index 66784eb..c78fcd6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -226,11 +226,12 @@ apply from: 'release.gradle'
 task toolchain(type:Exec,
     description: 'Setup dev. env via toolchain; Requires: Puppet, sudo',
     group: DEVENV_GROUP) {
-  def command = [
-      'sudo', 'puppet', 'apply', '-d', '--parser', 'future',
-      "--modulepath=${projectDir.absolutePath}:/etc/puppet/modules", '-e',
-      'include bigtop_toolchain::installer'
-  ]
+  def command = ['sudo', 'puppet', 'apply', '-d']
+  if ("puppet --version".execute().text[0] == '3') {
+    command.addAll(['--parser', 'future'])
+  }
+  
command.addAll(["--modulepath=${projectDir.absolutePath}:/etc/puppet/modules", 
'-e',
+      'include bigtop_toolchain::installer'])
   workingDir '.'
   commandLine command
 }

Reply via email to