diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-09-09 03:03:20 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-09-09 03:03:20 +0000 |
commit | f209e327ab078aa46e4e7a95688de924d8601c19 (patch) | |
tree | 7954faddcbec68bb37ea901ddcee511977d908da /neutron/pecan_wsgi | |
parent | 4b19661b2ac568b4241631ac078c76b273da9d7d (diff) | |
parent | 700d609ace818457093dc653264f84ffbdae4d86 (diff) | |
download | neutron-f209e327ab078aa46e4e7a95688de924d8601c19.tar.gz |
Merge "Pecan: strip duplicate and empty user fields"
Diffstat (limited to 'neutron/pecan_wsgi')
-rw-r--r-- | neutron/pecan_wsgi/controllers/utils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/neutron/pecan_wsgi/controllers/utils.py b/neutron/pecan_wsgi/controllers/utils.py index 83dd9eaeab..7cf6cd9f21 100644 --- a/neutron/pecan_wsgi/controllers/utils.py +++ b/neutron/pecan_wsgi/controllers/utils.py @@ -181,11 +181,13 @@ class NeutronPecanController(object): def build_field_list(self, request_fields): added_fields = [] combined_fields = [] - if request_fields: - req_fields_set = set(request_fields) + req_fields_set = {f for f in request_fields if f} + if req_fields_set: added_fields = self._mandatory_fields - req_fields_set combined_fields = req_fields_set | self._mandatory_fields - return list(combined_fields), list(added_fields) + # field sorting is to match old behavior of legacy API and to make + # this drop-in compatible with the old API unit tests + return sorted(combined_fields), list(added_fields) @property def plugin(self): |