goodness function cannot compare with string

Bug #1975715 reported by Maurice Escher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
kiran pawar

Bug Description

Hi,

I want to use a goodness_function like

(share.share_proto == "CIFS") ? 100 : 50

But this breaks on scheduling, it wants to convert it to a float..

Apparently I can't use strings.
This is working in cinder, I will prepare to copy it over.

BR,
Maurice

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/843288

Changed in manila:
status: New → In Progress
Changed in manila:
importance: Undecided → Medium
assignee: nobody → kiran pawar (kpdev)
milestone: none → zed-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/843288
Committed: https://opendev.org/openstack/manila/commit/a2ebe1eb9a54e15f842cdd85d32212f497e21c02
Submitter: "Zuul (22348)"
Branch: master

commit a2ebe1eb9a54e15f842cdd85d32212f497e21c02
Author: Maurice Escher <email address hidden>
Date: Wed May 25 11:38:46 2022 +0200

    Fix DriverFilter/GoodnessWeigher string evaluations

    When trying to compare two values that are non-numeric using the driver
    filter, the filter function will give an error. This is not desirable as
    it might be interesting to support comparatives with non-numeric values
    provided by the filter objects (share, host, etc). For example, the
    following formula failed before the fix:

    filter_function = '(share.project_id == "bb212f09317a4f4a8952ef3f729c2551")'

    Copied from cinder https://opendev.org/openstack/cinder/commit/87a7e80a2cbc4c8abcf4394242a02fcc5140e44b

    Closes-Bug: #1975715
    Change-Id: Icbfabb3bc0f608ebdd0784337db0921cc7763c53

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/manila/+/857474

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 15.0.0.0rc1

This issue was fixed in the openstack/manila 15.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/manila/+/857474
Committed: https://opendev.org/openstack/manila/commit/1c021168b85cdb39681581cca87f664cab59c93e
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 1c021168b85cdb39681581cca87f664cab59c93e
Author: Maurice Escher <email address hidden>
Date: Wed May 25 11:38:46 2022 +0200

    Fix DriverFilter/GoodnessWeigher string evaluations

    When trying to compare two values that are non-numeric using the driver
    filter, the filter function will give an error. This is not desirable as
    it might be interesting to support comparatives with non-numeric values
    provided by the filter objects (share, host, etc). For example, the
    following formula failed before the fix:

    filter_function = '(share.project_id == "bb212f09317a4f4a8952ef3f729c2551")'

    Copied from cinder https://opendev.org/openstack/cinder/commit/87a7e80a2cbc4c8abcf4394242a02fcc5140e44b

    Closes-Bug: #1975715
    Change-Id: Icbfabb3bc0f608ebdd0784337db0921cc7763c53
    (cherry picked from commit a2ebe1eb9a54e15f842cdd85d32212f497e21c02)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/manila/+/864032

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/manila/+/864032
Committed: https://opendev.org/openstack/manila/commit/d6a49cd5e36753c928f3d63a77997246ad0c7f12
Submitter: "Zuul (22348)"
Branch: stable/xena

commit d6a49cd5e36753c928f3d63a77997246ad0c7f12
Author: Maurice Escher <email address hidden>
Date: Wed May 25 11:38:46 2022 +0200

    Fix DriverFilter/GoodnessWeigher string evaluations

    When trying to compare two values that are non-numeric using the driver
    filter, the filter function will give an error. This is not desirable as
    it might be interesting to support comparatives with non-numeric values
    provided by the filter objects (share, host, etc). For example, the
    following formula failed before the fix:

    filter_function = '(share.project_id == "bb212f09317a4f4a8952ef3f729c2551")'

    Copied from cinder https://opendev.org/openstack/cinder/commit/87a7e80a2cbc4c8abcf4394242a02fcc5140e44b

    Closes-Bug: #1975715
    Change-Id: Icbfabb3bc0f608ebdd0784337db0921cc7763c53
    (cherry picked from commit a2ebe1eb9a54e15f842cdd85d32212f497e21c02)
    (cherry picked from commit 1c021168b85cdb39681581cca87f664cab59c93e)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/manila/+/866452

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 14.0.1

This issue was fixed in the openstack/manila 14.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 13.0.4

This issue was fixed in the openstack/manila 13.0.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/manila/+/866452
Committed: https://opendev.org/openstack/manila/commit/e2c05bc3848a6e980a52ea688e01258bcfa1b085
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit e2c05bc3848a6e980a52ea688e01258bcfa1b085
Author: Maurice Escher <email address hidden>
Date: Wed May 25 11:38:46 2022 +0200

    Fix DriverFilter/GoodnessWeigher string evaluations

    When trying to compare two values that are non-numeric using the driver
    filter, the filter function will give an error. This is not desirable as
    it might be interesting to support comparatives with non-numeric values
    provided by the filter objects (share, host, etc). For example, the
    following formula failed before the fix:

    filter_function = '(share.project_id == "bb212f09317a4f4a8952ef3f729c2551")'

    Copied from cinder https://opendev.org/openstack/cinder/commit/87a7e80a2cbc4c8abcf4394242a02fcc5140e44b

    Closes-Bug: #1975715
    Change-Id: Icbfabb3bc0f608ebdd0784337db0921cc7763c53
    (cherry picked from commit a2ebe1eb9a54e15f842cdd85d32212f497e21c02)
    (cherry picked from commit 1c021168b85cdb39681581cca87f664cab59c93e)
    (cherry picked from commit d6a49cd5e36753c928f3d63a77997246ad0c7f12)

tags: added: in-stable-wallaby
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.