Exemplo n.º 1
0
    def install_errata(self, entity_name, errata_id):
        """Install errata on a content host

        :param name: content host name to apply errata on
        :param errata_id: errata id or title, e.g. 'RHEA-2012:0055'

        :return: Returns a dict containing task status details
        """
        view = self.navigate_to(self, 'Edit', entity_name=entity_name)
        view.errata.search(errata_id)
        view.errata.table.row(id=errata_id)[0].widget.fill(True)
        view.errata.apply_selected.fill('Apply Selected')
        view.dialog.confirm()
        view = ContentHostTaskDetailsView(view.browser)
        view.progressbar.wait_for_result()
        return view.read()
Exemplo n.º 2
0
    def execute_package_action(self, entity_name, action_type, value):
        """Execute remote package action on a content host

        :param entity_name: content host name to remotely execute package
            action on
        :param action_type: remote action to execute. Can be one of 5: 'Package
            Install', 'Package Update', 'Package Remove', 'Group Install' or
            'Group Remove'
        :param value: Package or package group group name to remotely
            install/upgrade/remove (depending on `action_type`)

        :return: Returns a dict containing task status details
        """
        view = self.navigate_to(self, 'Edit', entity_name=entity_name)
        view.packages_actions.action_type.fill(action_type)
        view.packages_actions.name.fill(value)
        view.packages_actions.perform.click()
        view = ContentHostTaskDetailsView(view.browser)
        view.progressbar.wait_for_result()
        return view.read()
Exemplo n.º 3
0
    def execute_package_action(self,
                               entity_name,
                               action_type,
                               value,
                               installed_via='rex'):
        """Execute remote package action on a content host.

        The installation method is not set here, but the path changes according to the method used.
        For katello-agent, the Content Hosts' Task tab displays the progress. If REX is used,
        the Job Invocation view displays the progress. In 6.10, REX became the default method.

        :param entity_name: content host name to remotely execute package
            action on
        :param action_type: remote action to execute. Can be one of 5: 'Package
            Install', 'Package Update', 'Package Remove', 'Group Install' or
            'Group Remove'
        :param value: Package or package group group name to remotely
            install/upgrade/remove (depending on `action_type`)

        :param installed_via: what installation method was used (REX or katello-agent)

        :return: Returns a dict containing task status details
        """
        view = self.navigate_to(self, 'Edit', entity_name=entity_name)
        view.packages_actions.action_type.fill(action_type)
        view.packages_actions.name.fill(value)
        view.packages_actions.perform.click()
        if installed_via == 'katello':
            view = ContentHostTaskDetailsView(view.browser)
            view.progressbar.wait_for_result()
        else:
            view = JobInvocationStatusView(view.browser)
            view.wait_for_result()
        return view.read()
Exemplo n.º 4
0
    def install_errata(self, entity_name, errata_id, install_via=None):
        """Install errata on a content host

        :param name: content host name to apply errata on
        :param errata_id: errata id or title, e.g. 'RHEA-2012:0055'
        :param str install_via: via which mean to install errata. Available
            options: "katello", "rex", "rex_customize"

        :return: Returns a dict containing task status details
        """
        view = self.navigate_to(self, 'Edit', entity_name=entity_name)
        if errata_id == "All":
            view.errata.select_all.fill(True)
        else:
            view.errata.search(errata_id)
            view.errata.table.row(id=errata_id)[0].widget.fill(True)
        install_via_dict = {
            'katello': 'via Katello agent',
            'rex': 'via remote execution',
            'rex_customize': 'via remote execution - customize first',
        }
        view.errata.apply_selected.fill(install_via_dict[install_via])
        if install_via == 'katello':
            view = ContentHostTaskDetailsView(view.browser)
            view.progressbar.wait_for_result()
        else:
            view = JobInvocationStatusView(view.browser)
            view.wait_for_result()
        return view.read()