It is easy to see that default type of attestation_port is string.
But in action_url self.port is required as integer (%d).
It leads to conflict.
This change provides more tests than is required only to cover this bug
fix. This cases are testing AttestationService _do_request() method
using different status_codes and different texts returned by mocked
request method.
Reviewed: https:/ /review. openstack. org/128624 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=fdcf358eaee f6edb5c8d2dcc94 f906a22882544a
Committed: https:/
Submitter: Jenkins
Branch: master
commit fdcf358eaeef6ed b5c8d2dcc94f906 a22882544a
Author: Bartosz Fic <email address hidden>
Date: Mon Nov 17 12:04:59 2014 +0100
Type conflict in trusted_filter.py using attestation_port default value
When trusted filter (nova/nova/ scheduler/ filters/ trusted_ filter. py)
in nova scheduler is running with default value of attestation_port:
default='8443'
method _do_request() in AttestationService class has this line:
action_url = "https:/ /%s:%d%s/%s" % (self.host,
self.port, self.api_url, action_url)
It is easy to see that default type of attestation_port is string.
But in action_url self.port is required as integer (%d).
It leads to conflict.
This change provides more tests than is required only to cover this bug
fix. This cases are testing AttestationService _do_request() method
using different status_codes and different texts returned by mocked
request method.
Change-Id: I1ad57b5bd19863 60416948fd00dec 22456dc29a7
Closes-Bug: #1381468