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:
parent
ac3e21bb66
commit
7fcda18be0
@ -628,7 +628,7 @@ class Client(BaseClient):
|
||||
# NOTE(mrtenio): While the connection validation patch
|
||||
# is not accepted, we need to refer to the new validation.
|
||||
self._is_node_port_mac_compatible_with_server_hardware(
|
||||
self, node_info, ports)
|
||||
node_info, ports)
|
||||
|
||||
@auditing.audit
|
||||
def _is_node_port_mac_compatible_with_server_hardware(
|
||||
@ -651,8 +651,9 @@ class Client(BaseClient):
|
||||
)
|
||||
raise exceptions.OneViewInconsistentResource(message)
|
||||
|
||||
def validate_server_profile_template_mac_type(self, oneview_info):
|
||||
self._validate_server_profile_template_mac_type(self, oneview_info)
|
||||
def validate_server_profile_template_mac_type(self, spt_uuid):
|
||||
info = {"server_profile_template_uri": spt_uuid}
|
||||
self._validate_server_profile_template_mac_type(info)
|
||||
|
||||
@auditing.audit
|
||||
def _validate_server_profile_template_mac_type(self, oneview_info):
|
||||
|
@ -954,6 +954,22 @@ class OneViewClientTestCase(unittest.TestCase):
|
||||
setattr(profile_template_mock, "uri",
|
||||
"/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'}
|
||||
|
||||
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',
|
||||
autospec=True)
|
||||
def test_validate_server_profile_template_mac_type_negative(
|
||||
def test__validate_server_profile_template_mac_type_negative(
|
||||
self, server_template_mock):
|
||||
profile_template_mock = models.ServerProfileTemplate()
|
||||
setattr(profile_template_mock, "mac_type", "Virtual")
|
||||
|
Loading…
x
Reference in New Issue
Block a user