Example #1
0
    def create(self, item, attribute_converter={}):
        """Wraps around the create_or_update to build the config_keys
    that are passed to the create or update function.

    :param item: Entity item to work on
    :type item: nailgun.entities.item
    :param attribute_converter: will convert some attributes to classes' items
    This is used mostly when creating domains and subnets, defaults to {}
    :type attribute_converter: dict, optional
    :return: Then entity item created by the create_or_update() method
    :rtype: nailgun.entities.item
    """
        item.description = "Automatically generated by Forge for Satellite"
        # Some creation (ie domains and subnets) need to have access to other
        # classes like Org and Location for their creation.
        for att, class_name in attribute_converter.items():
            config_keys = getattr(item, att)
            log.debug(f"Config key {att} {config_keys} {class_name}")
            module = load_module(path.dirname(path.realpath(__file__)), att,
                                 class_name)
            setattr(
                item, att,
                list(
                    map(lambda x: module(self._cfg, name=x).get_or_new(x),
                        config_keys.split(','))))
        # CVFRs can't have desc
        for key in self._forbidden_keys:
            try:
                delattr(item, key)
            except AttributeError:
                pass
        return self.create_or_update(item)
Example #2
0
def task(id, incomplete, bad, reset_pulp):
    if id:
        load_module("check", "task")(cfg).get_by_id(id)
    elif incomplete:
        load_module("check", "task")(cfg).get_incompletes()
    elif bad:
        load_module("check", "task")(cfg).get_bads()
    elif reset_pulp:
        load_module("check", "task")(cfg).reset_pulp_task(reset_pulp)
Example #3
0
def check_cvs(delete, match):
    load_module("check", "contentview")(cfg, delete, match)
Example #4
0
def repos(repo_type, enabled, label):
    load_module("check", "reposet")(cfg, repo_type, enabled, label)
Example #5
0
def sync():
    log.info("Checking sync status")
    load_module("check", "sync")(cfg)
Example #6
0
def make_cvs(promote_only, composite_only, releases, zreleases, force):
    log.info("Generating content-views")
    load_module("make", "contentviews")(cfg, promote_only, composite_only,
                                        releases, zreleases, force)
Example #7
0
def container_prepare(releases, zreleases, output_dir, user, password):
    log.info("Generating container prepare templates")
    load_module("make", "containerprepare")(cfg, releases, zreleases,
                                            output_dir, user, password)
Example #8
0
def activation_keys(releases):
    log.info("Creating Activation Keys")
    load_module("make", "activationkeys")(cfg, releases)
Example #9
0
def container_repos(sync, releases):
    log.info("Generating products and adding repos")
    load_module("make", "containerrepos")(cfg, sync, releases)
Example #10
0
def repo_sets(sync):
    log.info("Enabling reposets")
    load_module("make", "reposets")(cfg, sync)
Example #11
0
def init():
    log.info("Initializaing satellite")
    load_module("make", "init")(cfg)
Example #12
0
def install(skip_tasks=[], only_tasks=[]):
    log.info("Running satellite-installer")
    load_module("install", "install")(cfg, skip_tasks, only_tasks)