~ahasenack/landscape-client/landscape-client-1.5.5-0ubuntu0.10.04.0

« back to all changes in this revision

Viewing changes to landscape/schema.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2010-06-28 18:07:18 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100628180718-vytyqgbtkiirv5sb
Tags: 1.5.2.1-0ubuntu0.10.04.0
Filter duplicate network interfaces in get_active_interfaces (LP: #597000)

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        else:
225
225
            optional = ["timestamp", "api"]
226
226
        super(Message, self).__init__(schema, optional=optional)
 
227
 
 
228
    def coerce(self, value):
 
229
        for k in value.keys():
 
230
            if k not in self.schema:
 
231
                # We don't know about this field, just discard it. This
 
232
                # is useful when a client that introduced some new field
 
233
                # in a message talks to an older server, that don't understand
 
234
                # the new field yet.
 
235
                value.pop(k)
 
236
        return super(Message, self).coerce(value)