def supports_option(java_home, option): """ Detects support for a specific option (or combination of options) for the JVM version available in java_home. :param java_home: The JAVA_HOME to use for probing. :param option: The JVM option or combination of JVM options (separated by spaces) to check. :return: True iff the provided ``option`` is supported on this JVM. """ return process.exit_status_as_bool(lambda: process.run_subprocess_with_logging("%s/bin/java %s -version" % (java_home, option)))
def supports_option(java_home, option): """ Detects support for a specific option (or combination of options) for the JVM version available in java_home. :param java_home: The JAVA_HOME to use for probing. :param option: The JVM option or combination of JVM options (separated by spaces) to check. :return: True iff the provided ``option`` is supported on this JVM. """ return process.exit_status_as_bool(lambda: process.run_subprocess_with_logging("%s/bin/java %s -version" % (java_home, option)))
def probe(src, *args, **kwargs): # Probe for -C if not process.exit_status_as_bool(lambda: process.run_subprocess_with_logging("git -C %s --version" % src, level=logging.DEBUG)): version = process.run_subprocess_with_output("git --version") if version: version = str(version).strip() else: version = "Unknown" raise exceptions.SystemSetupError("Your git version is [%s] but Rally requires at least git 1.9. Please update git." % version) return f(src, *args, **kwargs)
def probe(src, *args, **kwargs): # Probe for -C if not process.exit_status_as_bool(lambda: process.run_subprocess_with_logging( "git -C {} --version".format(src), level=logging.DEBUG), quiet=True): version = process.run_subprocess_with_output("git --version") if version: version = str(version).strip() else: version = "Unknown" raise exceptions.SystemSetupError("Your git version is [%s] but Rally requires at least git 1.9. Please update git." % version) return f(src, *args, **kwargs)