Esempio n. 1
0
 def test_prepare_node_is_successfuly_allocated_to_ironic(
         self, mock_save, mock_oneview_client):
     """`prepare` behavior when the node is free from OneView standpoint."""
     with task_manager.acquire(self.context, self.node.uuid) as task:
         task.node.provision_state = states.DEPLOYING
         deploy_utils.prepare(mock_oneview_client(), task)
         self.assertTrue(mock_save.called)
    def test_prepare_node_is_successfuly_allocated_to_ironic(
            self, mock_node_save, mock_get_ov_client):
        """`prepare` behavior when the node is free from OneView standpoint.

        """
        ov_client = mock_get_ov_client()
        fake_sh = oneview_models.ServerHardware()
        fake_sh.server_profile_uri = None
        ov_client.get_server_hardware_by_uuid.return_value = fake_sh
        with task_manager.acquire(self.context, self.node.uuid) as task:
            task.node.provision_state = states.DEPLOYING
            deploy_utils.prepare(task)
            self.assertTrue(ov_client.clone_template_and_apply.called)
            self.assertTrue(ov_client.get_server_profile_from_hardware)
Esempio n. 3
0
    def test_prepare_node_is_successfuly_allocated_to_ironic(
        self, mock_node_save, mock_get_ov_client
    ):
        """`prepare` behavior when the node is free from OneView standpoint.

        """
        oneview_client = mock_get_ov_client()

        fake_sh = oneview_models.ServerHardware()
        fake_sh.server_profile_uri = None
        oneview_client.get_server_hardware_by_uuid.return_value = fake_sh
        with task_manager.acquire(self.context, self.node.uuid) as task:
            task.node.provision_state = states.DEPLOYING
            deploy_utils.prepare(oneview_client, task)
            self.assertTrue(oneview_client.clone_template_and_apply.called)
            self.assertTrue(oneview_client.get_server_profile_from_hardware)
Esempio n. 4
0
 def prepare(self, task):
     deploy_utils.prepare(task)
     super(OneViewAgentDeploy, self).prepare(task)
Esempio n. 5
0
 def prepare(self, task):
     deploy_utils.prepare(self.client, task)
     super(OneViewIscsiDeploy, self).prepare(task)
Esempio n. 6
0
 def prepare(self, task):
     if common.is_dynamic_allocation_enabled(task.node):
         deploy_utils.prepare(self.oneview_client, task)
     super(OneViewAgentDeploy, self).prepare(task)
Esempio n. 7
0
 def prepare(self, task):
     if common.is_dynamic_allocation_enabled(task.node):
         deploy_utils.prepare(task)
     super(OneViewIscsiDeploy, self).prepare(task)
Esempio n. 8
0
 def prepare(self, task):
     deploy_utils.prepare(self.oneview_client, task)
     super(OneViewAgentDeploy, self).prepare(task)
Esempio n. 9
0
 def prepare(self, task):
     if common.is_dynamic_allocation_enabled(task.node):
         deploy_utils.prepare(self.oneview_client, task)
     super(OneViewAgentDeploy, self).prepare(task)