Exemple #1
0
    def test_tear_down(self, mock_get_ov_client):
        """`tear_down` behavior when node already has Profile applied

        """
        sp_uri = '/rest/server-profiles/1234556789'
        ov_client = mock_get_ov_client()
        fake_sh = oneview_models.ServerHardware()
        fake_sh.server_profile_uri = sp_uri
        ov_client = mock_get_ov_client.return_value
        ov_client.get_server_hardware_by_uuid.return_value = fake_sh

        with task_manager.acquire(self.context, self.node.uuid) as task:
            driver_info = task.node.driver_info
            driver_info['applied_server_profile_uri'] = \
                '/rest/server-profiles/1234556789'
            task.node.driver_info = driver_info

            self.assertTrue(
                'applied_server_profile_uri' in task.node.driver_info
            )
            deploy_utils.tear_down(ov_client, task)
            self.assertFalse(
                'applied_server_profile_uri' in task.node.driver_info
            )
        self.assertTrue(
            ov_client.delete_server_profile.called
        )
Exemple #2
0
 def test_tear_down(self, mock_oneview_client):
     """`tear_down` behavior when node already has Profile applied."""
     client = mock_oneview_client()
     with task_manager.acquire(self.context, self.node.uuid) as task:
         task.node.driver_info['applied_server_profile_uri'] = (
             '/rest/server-profiles/1234556789')
         self.assertIn('applied_server_profile_uri', task.node.driver_info)
         deploy_utils.tear_down(client, task)
         self.assertNotIn('applied_server_profile_uri',
                          task.node.driver_info)
         self.assertTrue(client.server_profiles.delete.called)
    def test_tear_down(self, mock_get_ov_client):
        """`tear_down` behavior when node already has Profile applied

        """
        ov_client = mock_get_ov_client()
        with task_manager.acquire(self.context, self.node.uuid) as task:
            driver_info = task.node.driver_info
            driver_info['applied_server_profile_uri'] = \
                '/rest/server-profiles/1234556789'
            task.node.driver_info = driver_info

            self.assertTrue(
                'applied_server_profile_uri' in task.node.driver_info)
            deploy_utils.tear_down(task)
            self.assertFalse(
                'applied_server_profile_uri' in task.node.driver_info)
        self.assertTrue(ov_client.delete_server_profile.called)
    def test_tear_down(self, mock_get_ov_client):
        """`tear_down` behavior when node already has Profile applied

        """
        oneview_client = mock_get_ov_client()

        with task_manager.acquire(self.context, self.node.uuid) as task:
            driver_info = task.node.driver_info
            driver_info['applied_server_profile_uri'] = \
                '/rest/server-profiles/1234556789'
            task.node.driver_info = driver_info

            self.assertTrue(
                'applied_server_profile_uri' in task.node.driver_info
            )
            deploy_utils.tear_down(oneview_client, task)
            self.assertFalse(
                'applied_server_profile_uri' in task.node.driver_info
            )
        self.assertTrue(
            oneview_client.delete_server_profile.called
        )
    def test_tear_down(self, mock_get_ov_client):
        """`tear_down` behavior when node already has Profile applied

        """
        sp_uri = '/rest/server-profiles/1234556789'
        ov_client = mock_get_ov_client()
        fake_sh = oneview_models.ServerHardware()
        fake_sh.server_profile_uri = sp_uri
        ov_client = mock_get_ov_client.return_value
        ov_client.get_server_hardware_by_uuid.return_value = fake_sh

        with task_manager.acquire(self.context, self.node.uuid) as task:
            driver_info = task.node.driver_info
            driver_info['applied_server_profile_uri'] = \
                '/rest/server-profiles/1234556789'
            task.node.driver_info = driver_info

            self.assertIn('applied_server_profile_uri', task.node.driver_info)
            deploy_utils.tear_down(ov_client, task)
            self.assertNotIn('applied_server_profile_uri',
                             task.node.driver_info)
        self.assertTrue(ov_client.delete_server_profile.called)
Exemple #6
0
 def tear_down(self, task):
     if not CONF.conductor.automated_clean:
         deploy_utils.tear_down(task)
     return super(OneViewAgentDeploy, self).tear_down(task)
Exemple #7
0
 def tear_down(self, task):
     if (common.is_dynamic_allocation_enabled(task.node)
             and not CONF.conductor.automated_clean):
         deploy_utils.tear_down(self.oneview_client, task)
     return super(OneViewAgentDeploy, self).tear_down(task)
Exemple #8
0
 def tear_down(self, task):
     if (common.is_dynamic_allocation_enabled(task.node)
             and not CONF.conductor.automated_clean):
         deploy_utils.tear_down(task)
     super(OneViewIscsiDeploy, self).tear_down(task)
Exemple #9
0
 def tear_down(self, task):
     if not CONF.conductor.automated_clean:
         deploy_utils.tear_down(self.oneview_client, task)
     return super(OneViewAgentDeploy, self).tear_down(task)
Exemple #10
0
 def tear_down(self, task):
     if not CONF.conductor.automated_clean:
         deploy_utils.tear_down(self.oneview_client, task)
     return super(OneViewIscsiDeploy, self).tear_down(task)
Exemple #11
0
 def tear_down(self, task):
     if (common.is_dynamic_allocation_enabled(task.node) and
        not CONF.conductor.automated_clean):
         deploy_utils.tear_down(self.oneview_client, task)
     return super(OneViewAgentDeploy, self).tear_down(task)