~johannes.erdfelt/glance/notifier

« back to all changes in this revision

Viewing changes to glance/common/client.py

  • Committer: Tarmac
  • Author(s): Brian Waldon
  • Date: 2011-06-29 00:52:47 UTC
  • mfrom: (147.1.2 filters-None)
  • Revision ID: tarmac-20110629005247-kiu99tm2r9qk8nf4
Prevent query params from being set to None instead of a dict

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
                               reduced to
169
169
        :retval subset of 'params' dict
170
170
        """
171
 
        result = actual_params.get('filters', {})
 
171
        try:
 
172
            # expect 'filters' param to be a dict here
 
173
            result = dict(actual_params.get('filters'))
 
174
        except TypeError:
 
175
            result = {}
 
176
 
172
177
        for allowed_param in allowed_params:
173
178
            if allowed_param in actual_params:
174
179
                result[allowed_param] = actual_params[allowed_param]
 
180
 
175
181
        return result