Example #1
0
        # pylint: disable=no-self-use
        source_dir = os.getcwd()
        log, workspace = cmd_general.init_env_noconfig(source_dir,
                                                       self._cvc_log_to_file,
                                                       True)
        cmd_general.check_argument_bool(log, "add_version", add_version)
        cmd_general.check_argument_bool(log, "add_major", add_major)
        cmd_general.check_argument_bool(log, "add_minor", add_minor)
        if new_extra is not None:
            new_extra = cmd_general.check_argument_str(log, "new_extra",
                                                       new_extra)
            if "-" in new_extra:
                log.cl_error("character [-] is not allowed in extra field [%s]",
                             new_extra)
                cmd_general.cmd_exit(log, -1)
        rc = _update_version(log, workspace, source_dir,
                             add_version=add_version,
                             add_major=add_major, add_minor=add_minor,
                             new_extra=new_extra)
        cmd_general.cmd_exit(log, rc)


build_common.coral_command_register("version", CoralVersionCommand())


def main():
    """
    main routine
    """
    Fire(build_common.CoralCommand)
Example #2
0
    if collectd is not None:
        collectd = cmd_general.check_argument_str(log, "collectd", collectd)
    cmd_general.check_argument_bool(log, "enable_zfs", enable_zfs)
    cmd_general.check_argument_bool(log, "enable_devel", enable_devel)
    if disable_plugin is not None:
        disable_plugin = cmd_general.check_argument_list_str(
            log, "disable_plugin", disable_plugin)
    cmd_general.check_argument_bool(log, "origin_mirror", origin_mirror)
    rc = coral_build.build(log,
                           source_dir,
                           workspace,
                           cache=cache,
                           lustre_rpms_dir=lustre,
                           e2fsprogs_rpms_dir=e2fsprogs,
                           collectd=collectd,
                           enable_zfs=enable_zfs,
                           enable_devel=enable_devel,
                           disable_plugin=disable_plugin,
                           origin_mirror=origin_mirror)
    cmd_general.cmd_exit(log, rc)


build_common.coral_command_register("build", build)


def main():
    """
    main routine
    """
    Fire(build_common.CoralCommand)
Example #3
0
    cmd_general.check_argument_bool(log, "tsinghua_mirror", tsinghua_mirror)
    rc = coral_build.build(log,
                           source_dir,
                           workspace,
                           cache=cache,
                           lustre_rpms_dir=lustre,
                           e2fsprogs_rpms_dir=e2fsprogs,
                           collectd=collectd,
                           enable_zfs=enable_zfs,
                           enable_devel=enable_devel,
                           disable_plugin=disable_plugin,
                           tsinghua_mirror=tsinghua_mirror)
    cmd_general.cmd_exit(log, rc)


build_common.coral_command_register("build", build)


def plugins(coral_command):
    """
    List the plugins of Coral.
    """
    # pylint: disable=unused-argument
    plugin_str = ""
    for plugin in build_common.CORAL_RELEASE_PLUGIN_DICT.values():
        if plugin_str == "":
            plugin_str = plugin.cpt_plugin_name
        else:
            plugin_str += "," + plugin.cpt_plugin_name
    sys.stdout.write(plugin_str + '\n')
Example #4
0
                              extra_rpm_names)
        if ret:
            log.cl_error("failed to build Barreleye")
            return -1
        return 0


class CoralBarreleCommand():
    """
    Commands to for building Barreleye plugin.
    """

    # pylint: disable=too-few-public-methods
    def _init(self, log_to_file):
        # pylint: disable=attribute-defined-outside-init
        self._cbc_log_to_file = log_to_file

    def urls(self):
        """
        Print the URLs to download dependency packages.
        """
        # pylint: disable=no-self-use
        log = clog.get_log(console_format=clog.FMT_NORMAL, overwrite=True)
        for package, url in PACAKGE_URL_DICT.items():
            log.cl_stdout("%s: %s", package, url)
        cmd_general.cmd_exit(log, 0)


build_common.coral_command_register("barrele", CoralBarreleCommand())
build_common.coral_plugin_register(CoralBarrelePlugin())
Example #5
0
                        "between languages, %s vs. %s", relative_fpath,
                        old_line_number, line_number)
                    return -1
            else:
                line_number_dict[relative_fpath] = line_number
    return 0


class CoralDocCommand():
    """
    Commands to for building doc.
    """

    # pylint: disable=too-few-public-methods
    def _init(self, log_to_file):
        # pylint: disable=attribute-defined-outside-init
        self._cdc_log_to_file = log_to_file

    def check(self):
        """
        check whether the documents.
        """
        # pylint: disable=no-self-use
        log = clog.get_log(console_format=clog.FMT_NORMAL, overwrite=True)
        doc_dir = os.getcwd() + "/doc"
        rc = check_doc(log, doc_dir)
        cmd_general.cmd_exit(log, rc)


build_common.coral_command_register("doc", CoralDocCommand())