Consolidate get_*nodes* functions

Bug #1271291 reported by aeva black
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Low
Yuriy Zveryanskyy

Bug Description

http://git.openstack.org/cgit/openstack/ironic/tree/ironic/db/sqlalchemy/api.py?id=3af35b4093a07eb2a36a4493b0ff863aa95d3fed#n184

There are currently 5 separate methods to get a node or list of nodes, based on some filter paramter, which return a node object. There's one method (get_nodeinfo_list) which is much more flexible and returns a dict of fields, but takes many filter parameters and covers the same functionality as the other 5 methods.

We should consolidate the following methods into something more maintainable and flexible.
- get_node
- get_node_list
- get_nodeinfo_list
- get_node_by_instance
- get_associated_nodes
- get_unassociated_nodes
- get_nodes_by_chassis

aeva black (tenbrae)
Changed in ironic:
status: New → Triaged
importance: Undecided → Low
tags: added: low-hanging-fruit
description: updated
Michael Davies (mrda)
Changed in ironic:
assignee: nobody → Michael Davies (mrda)
Michael Davies (mrda)
Changed in ironic:
status: Triaged → In Progress
Revision history for this message
Michael Davies (mrda) wrote :

This bug has has significant overlap with the implementation of bug/1260099 (refer https://review.openstack.org/#/c/63937/7), so should be considered as part of that fix.

Changed in ironic:
assignee: Michael Davies (mrda) → nobody
Changed in ironic:
assignee: nobody → Yuriy Zveryanskyy (yzveryanskyy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/63937
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=487f6738bcb331115b49a88f21520b412cdcc49c
Submitter: Jenkins
Branch: master

commit 487f6738bcb331115b49a88f21520b412cdcc49c
Author: Yuriy Zveryanskyy <email address hidden>
Date: Tue Dec 24 15:41:54 2013 +0200

    Add parameter for filtering nodes by maintenance mode

    Boolean parameter 'maintenance' added to API for filtering
    nodes by maintenance mode, example:
    /nodes?maintenance=false
    strutils.bool_from_string() used for converting 'associated'
    and 'maintenance' parameters, accepted values now for True
    ('1', 't', 'true', 'on', 'y', 'yes'), for False
    ('0', 'f', 'false', 'off', 'n', 'no') case-insensitive.
    Refactored dbapi method get_node_list with filters used for
    _get_nodes_collection in nodes controller.

    Partial-Bug: #1260099
    Partial-Bug: #1271291
    Change-Id: I01a62eb641316e890d191cf569bb3cf00b7619f2

aeva black (tenbrae)
Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: icehouse-3 → 2014.1
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.