Type conflict in nova/nova/scheduler/filters/trusted_filter.py using attestation_port default value

Bug #1381468 reported by Bartosz Fic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Bartosz Fic
Icehouse
Fix Released
Undecided
Unassigned
Juno
Fix Released
High
Matthew Booth

Bug Description

When trusted filter in nova scheduler is running with default value of attestation_port:

cfg.StrOpt('attestation_port', default='8443', help='Attestation server port'),

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.

Changed in nova:
assignee: nobody → Bartosz Fic (bartosz-fic)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/128624

Revision history for this message
Bartosz Fic (bartosz-fic) wrote :

I've commited few tests.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/128624
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fdcf358eaeef6edb5c8d2dcc94f906a22882544a
Submitter: Jenkins
Branch: master

commit fdcf358eaeef6edb5c8d2dcc94f906a22882544a
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: I1ad57b5bd1986360416948fd00dec22456dc29a7
    Closes-Bug: #1381468

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/176797

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/176873

Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/juno)

Reviewed: https://review.openstack.org/176797
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b251958e61a62aea7facea574e7aca366af4b004
Submitter: Jenkins
Branch: stable/juno

commit b251958e61a62aea7facea574e7aca366af4b004
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.

    (cherry picked from commit fdcf358eaeef6edb5c8d2dcc94f906a22882544a)

    Conflicts:
     nova/tests/unit/scheduler/filters/test_trusted_filters.py

    Tests aren't in tests/unit/.

    Use jsonutils from nova.openstack.common instead of oslo.utils.

    Closes-Bug: #1381468
    Change-Id: I1ad57b5bd1986360416948fd00dec22456dc29a7

tags: added: in-stable-juno
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/176873
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b77c188ad686970184edd0821986a912c2643dc5
Submitter: Jenkins
Branch: stable/icehouse

commit b77c188ad686970184edd0821986a912c2643dc5
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.

    (cherry picked from commit fdcf358eaeef6edb5c8d2dcc94f906a22882544a)

    Conflicts:
     nova/tests/unit/scheduler/filters/test_trusted_filters.py

    Tests aren't in tests/unit/.

    Use jsonutils from nova.openstack.common instead of oslo.utils.

    (cherry picked from commit b251958e61a62aea7facea574e7aca366af4b004)

    Closes-Bug: #1381468
    Change-Id: I1ad57b5bd1986360416948fd00dec22456dc29a7

tags: added: in-stable-icehouse
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.