コード例 #1
0
    def run_smartstate_analysis(self, wait_for_task_result=False):
        """ Runs smartstate analysis on this host

        Note:
            The host must have valid credentials already set up for this to work.
        """
        view = navigate_to(self, 'DetailsFromProvider')
        try:
            wait_for(lambda: view.toolbar.configuration.item_enabled(
                'Perform SmartState Analysis'),
                     fail_condition=False,
                     num_sec=10)
        except TimedOutError:
            raise MenuItemNotFound(
                'Smart State analysis is disabled for this datastore')
        view.toolbar.configuration.item_select('Perform SmartState Analysis',
                                               handle_alert=True)
        view.flash.assert_success_message(('"{}": scan successfully '
                                           'initiated'.format(self.name)))
        if wait_for_task_result:
            view = self.appliance.browser.create_view(TasksView)
            wait_for(lambda: is_datastore_analysis_finished(self.name),
                     delay=15,
                     timeout="15m",
                     fail_func=view.reload.click)
コード例 #2
0
    def run_smartstate_analysis(self, wait_for_task_result=False):
        """ Runs smartstate analysis on this host

        Note:
            The host must have valid credentials already set up for this to work.
        """
        view = navigate_to(self, 'DetailsFromProvider')
        try:
            wait_for(lambda: view.toolbar.configuration.item_enabled(
                'Perform SmartState Analysis'),
                     fail_condition=False,
                     num_sec=10)
        except TimedOutError:
            raise MenuItemNotFound(
                'Smart State analysis is disabled for this datastore')
        view.toolbar.configuration.item_select('Perform SmartState Analysis',
                                               handle_alert=True)
        view.flash.assert_success_message(('"{}": scan successfully '
                                           'initiated'.format(self.name)))
        if wait_for_task_result:
            task = self.appliance.collections.tasks.instantiate(
                name="SmartState Analysis for [{}]".format(self.name),
                tab='MyOtherTasks')
            task.wait_for_finished()
            return task