~ubuntu-branches/ubuntu/raring/glance/raring-updates

« back to all changes in this revision

Viewing changes to glance/schema.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandleman, Chuck Short
  • Date: 2012-08-16 13:58:32 UTC
  • mfrom: (1.1.41)
  • Revision ID: package-import@ubuntu.com-20120816135832-4m40ppptd1l073fr
Tags: 2012.2~f3-0ubuntu1
[ Adam Gandleman ]
* debian/patches/sql_conn.patch: Also set default sqlite path for
  in glance-api.conf. (LP: #1028711)
* debian/patches/fix-docs-build.patch: Fix docs build

[ Chuck Short ]
* New upstream version.
* debian/control: python-xattr is no longer a required depends.
  (LP: #1031396)
* debian/control: Move python-jsonschema to glance.
  (LP: #1030152)
* debian/control: Start the slow transition to python-glanceclient.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    def filter(self, obj):
37
37
        filtered = {}
38
38
        for key, value in obj.iteritems():
39
 
            if key in self.properties:
 
39
            if self._filter_func(self.properties, key) and value is not None:
40
40
                filtered[key] = value
41
41
        return filtered
42
42
 
 
43
    @staticmethod
 
44
    def _filter_func(properties, key):
 
45
        return key in properties
 
46
 
43
47
    def merge_properties(self, properties):
44
48
        # Ensure custom props aren't attempting to override base props
45
49
        original_keys = set(self.properties.keys())
67
71
 
68
72
 
69
73
class PermissiveSchema(Schema):
70
 
    def filter(self, obj):
71
 
        return obj
 
74
    @staticmethod
 
75
    def _filter_func(properties, key):
 
76
        return True
72
77
 
73
78
    def raw(self):
74
79
        raw = super(PermissiveSchema, self).raw()