Remove self from method calling
Remove self from the method calling when using _is_node_port_mac_compatible_with_server_hardware and _validate_server_profile_template_mac_type Change-Id: I60467a61c28c9ccab35c83f16659d8697023fb39 Co-Authored-By: Saulo-Aislan <sauloa@lsd.ufcg.edu.br>
This commit is contained in:
committed by
Saulo-Aislan
parent
ac3e21bb66
commit
7fcda18be0
@@ -628,7 +628,7 @@ class Client(BaseClient):
|
|||||||
# NOTE(mrtenio): While the connection validation patch
|
# NOTE(mrtenio): While the connection validation patch
|
||||||
# is not accepted, we need to refer to the new validation.
|
# is not accepted, we need to refer to the new validation.
|
||||||
self._is_node_port_mac_compatible_with_server_hardware(
|
self._is_node_port_mac_compatible_with_server_hardware(
|
||||||
self, node_info, ports)
|
node_info, ports)
|
||||||
|
|
||||||
@auditing.audit
|
@auditing.audit
|
||||||
def _is_node_port_mac_compatible_with_server_hardware(
|
def _is_node_port_mac_compatible_with_server_hardware(
|
||||||
@@ -651,8 +651,9 @@ class Client(BaseClient):
|
|||||||
)
|
)
|
||||||
raise exceptions.OneViewInconsistentResource(message)
|
raise exceptions.OneViewInconsistentResource(message)
|
||||||
|
|
||||||
def validate_server_profile_template_mac_type(self, oneview_info):
|
def validate_server_profile_template_mac_type(self, spt_uuid):
|
||||||
self._validate_server_profile_template_mac_type(self, oneview_info)
|
info = {"server_profile_template_uri": spt_uuid}
|
||||||
|
self._validate_server_profile_template_mac_type(info)
|
||||||
|
|
||||||
@auditing.audit
|
@auditing.audit
|
||||||
def _validate_server_profile_template_mac_type(self, oneview_info):
|
def _validate_server_profile_template_mac_type(self, oneview_info):
|
||||||
|
|||||||
@@ -954,6 +954,22 @@ class OneViewClientTestCase(unittest.TestCase):
|
|||||||
setattr(profile_template_mock, "uri",
|
setattr(profile_template_mock, "uri",
|
||||||
"/rest/server-profile-templates/%s" % '111-222-333')
|
"/rest/server-profile-templates/%s" % '111-222-333')
|
||||||
|
|
||||||
|
stp_uuid = '111-222-333'
|
||||||
|
|
||||||
|
server_template_mock.return_value = profile_template_mock
|
||||||
|
self.oneview_client.validate_server_profile_template_mac_type(
|
||||||
|
stp_uuid
|
||||||
|
)
|
||||||
|
|
||||||
|
@mock.patch.object(client.Client, 'get_server_profile_template',
|
||||||
|
autospec=True)
|
||||||
|
def test__validate_server_profile_template_mac_type(
|
||||||
|
self, server_template_mock):
|
||||||
|
profile_template_mock = models.ServerProfileTemplate()
|
||||||
|
setattr(profile_template_mock, "mac_type", "Physical")
|
||||||
|
setattr(profile_template_mock, "uri",
|
||||||
|
"/rest/server-profile-templates/%s" % '111-222-333')
|
||||||
|
|
||||||
oneview_info = {'server_profile_template_uri': '/rest/111-222-333'}
|
oneview_info = {'server_profile_template_uri': '/rest/111-222-333'}
|
||||||
|
|
||||||
server_template_mock.return_value = profile_template_mock
|
server_template_mock.return_value = profile_template_mock
|
||||||
@@ -963,7 +979,7 @@ class OneViewClientTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
@mock.patch.object(client.Client, 'get_server_profile_template',
|
@mock.patch.object(client.Client, 'get_server_profile_template',
|
||||||
autospec=True)
|
autospec=True)
|
||||||
def test_validate_server_profile_template_mac_type_negative(
|
def test__validate_server_profile_template_mac_type_negative(
|
||||||
self, server_template_mock):
|
self, server_template_mock):
|
||||||
profile_template_mock = models.ServerProfileTemplate()
|
profile_template_mock = models.ServerProfileTemplate()
|
||||||
setattr(profile_template_mock, "mac_type", "Virtual")
|
setattr(profile_template_mock, "mac_type", "Virtual")
|
||||||
|
|||||||
Reference in New Issue
Block a user