Metering - metering-label-rule doesn't need 'tenant_id'

Bug #1624276 reported by Yushiro FURUKAWA
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Low
Ukesh
python-neutronclient
Invalid
Undecided
Ukesh

Bug Description

In current metering-label-rule, 'tenant_id' is included into RESOURCE_ATTRIBUTE_MAP[1].
However, even if we specify 'tenant_id' by using CLI or REST-API, 'tenant_id'
isn't stored on DB[2] and we cannot see the result. Therefore, I think
following fixes are necessary:

1. 'tenant_id' definition should be removed at extensions/metering.py.
2. Remove 'tenant_id' option from CLI(meter-label-rule)

[CLI]
(neutron) meter-label-rule-create my-label 192.168.2.0/24 --tenant-id 8ae2759224e94ed0a66011315a32d07c
Created a new metering_label_rule:
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| direction | ingress |
| excluded | False |
| id | 4ef89142-b216-42c7-9455-abc3a8fd1d3d |
| metering_label_id | 543ce87e-2190-46d5-9d79-3fd113681372 |
| remote_ip_prefix | 192.168.2.0/24 |
+-------------------+--------------------------------------+

[REST-API]
$ source devstack/openrc admin admin
$ export TOKEN=`openstack token issue | grep ' id ' | get_field 2`
$ curl -s -X POST -H "accept:application/json" -H "content-type: application/json" -d '{"metering_label_rule": {"remote_ip_prefix": "172.16.3.0/24", "metering_label_id": "d34c612f-3e02-433b-ba9f-f13b2ac6511d", "direction": "ingress", "excluded": false, "tenant_id": "8ae2759224e94ed0a66011315a32d07c"}}' -H "x-auth-token:$TOKEN" localhost:9696/v2.0/metering/metering-label-rules | jq "."

{
  "metering_label_rule": {
    "remote_ip_prefix": "172.16.3.0/24",
    "direction": "ingress",
    "metering_label_id": "d34c612f-3e02-433b-ba9f-f13b2ac6511d",
    "id": "d300512f-db84-4680-92cd-dafb91bec33b",
    "excluded": false
  }
}

[1] https://github.com/openstack/neutron/blob/master/neutron/extensions/metering.py#L79
[2] https://github.com/openstack/neutron/blob/master/neutron/db/metering/metering_db.py#L171

Tags: api metering
Revision history for this message
Dariusz Smigiel (smigiel-dariusz) wrote :

The only fields that are applicable to Metering Label Rule are: direction, remote_ip_prefix, excluded and metering_label_id.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
tags: added: api
Ukesh (ukeshkumar)
Changed in neutron:
assignee: nobody → Ukesh (ukeshkumar)
Ukesh (ukeshkumar)
Changed in python-neutronclient:
assignee: nobody → Ukesh (ukeshkumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
Miguel Lavalle (minsel) wrote :

I don't think this is a valid bug. Please see my comment to https://review.openstack.org/377664

Changed in neutron:
status: In Progress → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Ukesh Kumar (<email address hidden>) on branch: master
Review: https://review.openstack.org/377664
Reason: since the bug is marked as invalid

Ukesh (ukeshkumar)
Changed in python-neutronclient:
status: New → Invalid
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.