def exec_storm_class(klass, jvmtype='-server', jvmopts=[], extrajars=[], args=[], fork=False, daemon=True, client=False, daemonName=''):
    global CONFFILE
    storm_log_dir = confvalue('storm.log.dir', [CLUSTER_CONF_DIR])
    if ((storm_log_dir == None) or (storm_log_dir == 'null')):
        storm_log_dir = os.path.join(STORM_DIR, 'logs')
    all_args = ((([JAVA_CMD, jvmtype, ('-Ddaemon.name=' + daemonName), get_config_opts(), ('-Dstorm.home=' + STORM_DIR), ('-Dstorm.log.dir=' + storm_log_dir), ('-Djava.library.path=' + confvalue('java.library.path', extrajars, daemon)), ('-Dstorm.conf.file=' + CONFFILE), '-cp', get_classpath(extrajars, daemon, client=client)] + jvmopts) + [klass]) + list(args))
    print(('Running: ' + ' '.join(all_args)))
    sys.stdout.flush()
    exit_code = 0
    if fork:
        exit_code = os.spawnvp(os.P_WAIT, JAVA_CMD, all_args)
    elif is_windows():
        try:
            ret = sub.check_output(all_args, stderr=sub.STDOUT)
            print(ret)
        except sub.CalledProcessError as e:
            print(e.output)
            sys.exit(e.returncode)
    else:
        os.execvp(JAVA_CMD, all_args)
    return exit_code
def exec_storm_class(klass, jvmtype='-server', jvmopts=[], extrajars=[], args=[], fork=False, daemon=True, client=False, daemonName=):
    global CONFFILE
    storm_log_dir = confvalue('storm.log.dir', [CLUSTER_CONF_DIR])
    if ((storm_log_dir == None) or (storm_log_dir == 'null')):
        storm_log_dir = os.path.join(STORM_DIR, 'logs')
    all_args = ((([JAVA_CMD, jvmtype, ('-Ddaemon.name=' + daemonName), get_config_opts(), ('-Dstorm.home=' + STORM_DIR), ('-Dstorm.log.dir=' + storm_log_dir), ('-Djava.library.path=' + confvalue('java.library.path', extrajars, daemon)), ('-Dstorm.conf.file=' + CONFFILE), '-cp', get_classpath(extrajars, daemon, client=client)] + jvmopts) + [klass]) + list(args))
    print(('Running: ' + ' '.join(all_args)))
    sys.stdout.flush()
    exit_code = 0
    if fork:
        exit_code = os.spawnvp(os.P_WAIT, JAVA_CMD, all_args)
    elif is_windows():
        try:
            ret = sub.check_output(all_args, stderr=sub.STDOUT)
            print(ret)
        except sub.CalledProcessError as e:
            print(e.output)
            sys.exit(e.returncode)
    else:
        os.execvp(JAVA_CMD, all_args)
    return exit_code