commit | 96fdc0aef99857c7d402ce2a1943529429b1b33e | [log] [tgz] |
---|---|---|
author | Your Name <you@example.com> | Fri May 05 12:56:28 2017 +0000 |
committer | Vasyl Saienko <vsaienko@mirantis.com> | Wed May 10 10:46:00 2017 +0300 |
tree | ae1fb8e2a22f63016f4418b6865b2bfbd5262c2e | |
parent | b4ca8adbfc1e2bee89d76e714a6289e03418ae05 [diff] |
Refactor neutrong state and module (part 1) _authenticate decorator automatically merges dictionaries in array if they have 'name' or 'id' key [0]. This poses a problem since OpenStack resource names (networks/subnets/routers/instances etc) are generally not required to be unique. Thus trying to get list of any resource from neutronng module will lead to merging of resources with the same name. For example if tenant has two networks with the same name calling `salt '*' neutronng.list_networks profile=admin` will show only one. This patch updates the following functions in neutronng: * list_subnets * list_networks to return a dictionary as it is returned from Neutron API as it is done in the upstream salt network module [1]. Also fix passing profile with connection_args in _auth() method. TODO: refactor other functions. [0] https://github.com/salt-formulas/salt-formula-neutron/blob/master/_modules/neutronng.py#L60 [1] https://github.com/saltstack/salt/blob/c3579e9284d76c79df42974a322954c208cc7cb1/salt/modules/neutron.py#L354 Change-Id: If9f666ef397386746f3cce51f220c3d75d7fef72