Enables Py34 tests for unit.api.openstack.compute.test_server_actions
Adds encode('utf-8') to input data to pass py34 test. Change-Id: Ib305f6f2ba61c8568d9d533104ddd2ff904e49ae PartiallyImplements: blueprint nova-python3-newton
This commit is contained in:
parent
414df1e56e
commit
ec2301ea03
@ -215,7 +215,8 @@ class ViewBuilder(common.ViewBuilder):
|
|||||||
host = instance.get("host")
|
host = instance.get("host")
|
||||||
project = str(instance.get("project_id"))
|
project = str(instance.get("project_id"))
|
||||||
if host:
|
if host:
|
||||||
sha_hash = hashlib.sha224(project + host)
|
data = (project + host).encode('utf-8')
|
||||||
|
sha_hash = hashlib.sha224(data)
|
||||||
return sha_hash.hexdigest()
|
return sha_hash.hexdigest()
|
||||||
|
|
||||||
def _get_addresses(self, request, instance, extend_address=False):
|
def _get_addresses(self, request, instance, extend_address=False):
|
||||||
|
@ -315,7 +315,7 @@ class ServerActionsControllerTestV21(test.TestCase):
|
|||||||
self.assertEqual(len(body['server']['adminPass']),
|
self.assertEqual(len(body['server']['adminPass']),
|
||||||
CONF.password_length)
|
CONF.password_length)
|
||||||
|
|
||||||
self.assertEqual(robj['location'], self_href)
|
self.assertEqual(robj['location'], self_href.encode('utf-8'))
|
||||||
|
|
||||||
def test_rebuild_instance_with_image_uuid(self):
|
def test_rebuild_instance_with_image_uuid(self):
|
||||||
info = dict(image_href_in_call=None)
|
info = dict(image_href_in_call=None)
|
||||||
@ -379,7 +379,7 @@ class ServerActionsControllerTestV21(test.TestCase):
|
|||||||
self.assertEqual(body['server']['image']['id'], '2')
|
self.assertEqual(body['server']['image']['id'], '2')
|
||||||
self.assertNotIn("adminPass", body['server'])
|
self.assertNotIn("adminPass", body['server'])
|
||||||
|
|
||||||
self.assertEqual(robj['location'], self_href)
|
self.assertEqual(robj['location'], self_href.encode('utf-8'))
|
||||||
|
|
||||||
def test_rebuild_raises_conflict_on_invalid_state(self):
|
def test_rebuild_raises_conflict_on_invalid_state(self):
|
||||||
body = {
|
body = {
|
||||||
|
@ -20,7 +20,6 @@ nova.tests.unit.api.openstack.compute.test_security_group_default_rules.TestSecu
|
|||||||
nova.tests.unit.api.openstack.compute.test_security_group_default_rules.TestSecurityGroupDefaultRulesV21
|
nova.tests.unit.api.openstack.compute.test_security_group_default_rules.TestSecurityGroupDefaultRulesV21
|
||||||
nova.tests.unit.api.openstack.compute.test_security_groups.SecurityGroupsOutputTestV21
|
nova.tests.unit.api.openstack.compute.test_security_groups.SecurityGroupsOutputTestV21
|
||||||
nova.tests.unit.api.openstack.compute.test_security_groups.TestSecurityGroupRulesV21
|
nova.tests.unit.api.openstack.compute.test_security_groups.TestSecurityGroupRulesV21
|
||||||
nova.tests.unit.api.openstack.compute.test_server_actions.ServerActionsControllerTestV21
|
|
||||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerCreateTest
|
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerCreateTest
|
||||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerRebuildInstanceTest
|
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerRebuildInstanceTest
|
||||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerRebuildTestV219
|
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerRebuildTestV219
|
||||||
|
Loading…
Reference in New Issue
Block a user