Fields should not be named the built-in type keyword

Bug #1533392 reported by Taylor Peoples on 2016-01-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-watcherclient
Undecided
Digambar
watcher
Low
Digambar
watcher-dashboard
Low
David TARDIVEL

Bug Description

There's a number of places where a field of an object is named "type", which isn't the best thing to do since type is a python built-in. For example, see Audit and Event.

Changed in watcher:
assignee: nobody → Taylor Peoples (tpeoples)
Changed in watcher:
milestone: none → mitaka-3
tags: added: low-hanging-fruit
Changed in watcher:
milestone: mitaka-3 → mitaka-rc-1
Changed in watcher:
status: New → Triaged
importance: Wishlist → Low
Changed in watcher:
milestone: mitaka-rc-1 → mitaka-rc-final
Changed in watcher:
milestone: mitaka-rc-final → newton-1
Changed in watcher:
milestone: newton-1 → newton-2
Jean-Emile DARTOIS (jed56) wrote :

Hello Talyor,
Are you still working on this bug ?

Changed in watcher:
assignee: Taylor Peoples (tpeoples) → nobody
Changed in watcher:
assignee: nobody → Digambar (digambarpatil15)

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

Changed in watcher:
status: Triaged → In Progress
Digambar (digambarpatil15) wrote :

I think this is not only about changing the type keyword to audit_type but it requires changes in db models & if we want to add or update field name in models it requires sqlalchemy migration.

Changed in python-watcherclient:
assignee: nobody → Digambar (digambarpatil15)

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

Changed in python-watcherclient:
status: New → In Progress

Reviewed: https://review.openstack.org/338391
Committed: https://git.openstack.org/cgit/openstack/python-watcherclient/commit/?id=75dd8dc561ed38ab85b020518258ccb0d758d360
Submitter: Jenkins
Branch: master

commit 75dd8dc561ed38ab85b020518258ccb0d758d360
Author: digambar <email address hidden>
Date: Wed Jul 6 21:55:10 2016 +0530

    Fix field type to audit_type

    There's a number of places where a field of an object is named "type",
    which isn't good thing. Actually type is keyword in python, so wherever
    I found type used in models/api/object/test, I have fixed it to
    audit_type in the audit files

    Change-Id: Ic09458b455820787f5483e48aed940a2196b297e
    Closes-Bug: #1533392

Changed in python-watcherclient:
status: In Progress → Fix Released
Changed in watcher:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/336390
Committed: https://git.openstack.org/cgit/openstack/watcher/commit/?id=47ff9bb105b78d1ed1fb0f4ea31c7e3a76eeacd1
Submitter: Jenkins
Branch: master

commit 47ff9bb105b78d1ed1fb0f4ea31c7e3a76eeacd1
Author: digambar <email address hidden>
Date: Mon Jul 4 22:50:53 2016 +0530

    Fix field type to audit_type

    There's a number of places where a field of an object is named "type",
    which isn't good thing. Actually type is keyword in python, so wherever
    I found type used in models/api/object/test, I have fixed it to
    audit_type in the audit files

    Change-Id: Iea6bd3acb0b2af2a833b3916701aad88f6064bba
    Closes-Bug: #1533392

This issue was fixed in the openstack/python-watcherclient 0.24.0 release.

This issue was fixed in the openstack/watcher 0.28.0 release.

Changed in watcher-dashboard:
status: New → Triaged
importance: Undecided → Low
Changed in watcher-dashboard:
milestone: none → newton-rc-final
Changed in watcher-dashboard:
status: Triaged → In Progress
assignee: nobody → David TARDIVEL (david-tardivel)

Reviewed: https://review.openstack.org/372583
Committed: https://git.openstack.org/cgit/openstack/watcher-dashboard/commit/?id=ea6c773facb3c4738b3372d737c8e13a618e8d85
Submitter: Jenkins
Branch: master

commit ea6c773facb3c4738b3372d737c8e13a618e8d85
Author: David TARDIVEL <email address hidden>
Date: Mon Sep 19 17:31:57 2016 +0200

    Clean the code by renaming 'type' parameters

    Closes-bug: #1533392
    Change-Id: I02b6aae718a3a7d043c3316dbdccec5e2ade5d2a

This issue was fixed in the openstack/watcher-dashboard 0.5.0 release.

Changed in watcher-dashboard:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers