Cleans default declaration nullable=False from heat objects

In Heat objects, the default value of nullable attribute is
set in many of the object's fields, which is not required
as oslo object Field defines nullable as False by default

Change-Id: I0164b64c043816f624aeba19561a4a5f8d36689d
Closes-bug: #1439957
This commit is contained in:
Kanagaraj Manickam 2015-04-03 12:27:38 +05:30
parent 0a1639a5bc
commit 39368e2f6a
8 changed files with 17 additions and 17 deletions

View File

@ -25,9 +25,9 @@ from heat.objects import fields as heat_fields
class Event(base.VersionedObject, base.VersionedObjectDictCompat):
fields = {
'id': fields.IntegerField(nullable=False),
'stack_id': fields.StringField(nullable=False),
'uuid': fields.StringField(nullable=False),
'id': fields.IntegerField(),
'stack_id': fields.StringField(),
'uuid': fields.StringField(),
'resource_action': fields.StringField(nullable=True),
'resource_status': fields.StringField(nullable=True),
'resource_name': fields.StringField(nullable=True),

View File

@ -35,7 +35,7 @@ class Resource(
fields = {
'id': fields.IntegerField(),
'uuid': fields.StringField(),
'stack_id': fields.StringField(nullable=False),
'stack_id': fields.StringField(),
'created_at': fields.DateTimeField(read_only=True),
'updated_at': fields.DateTimeField(nullable=True),
'nova_instance': fields.StringField(nullable=True),
@ -49,7 +49,7 @@ class Resource(
resource_data.ResourceData,
nullable=True
),
'stack': fields.ObjectField(stack.Stack, nullable=False),
'stack': fields.ObjectField(stack.Stack),
'engine_id': fields.StringField(nullable=True),
'atomic_key': fields.IntegerField(nullable=True),
'current_template_id': fields.IntegerField(),

View File

@ -36,7 +36,7 @@ class ResourceData(
'key': fields.StringField(nullable=True),
'value': fields.StringField(nullable=True),
'redact': fields.BooleanField(nullable=True),
'resource_id': fields.IntegerField(nullable=False),
'resource_id': fields.IntegerField(),
'decrypt_method': fields.StringField(nullable=True),
}

View File

@ -31,9 +31,9 @@ class Snapshot(base.VersionedObject,
fields = {
'id': fields.StringField(),
'name': fields.StringField(nullable=True),
'stack_id': fields.StringField(nullable=False),
'stack_id': fields.StringField(),
'data': heat_fields.JsonField(nullable=True),
'tenant': fields.StringField(nullable=False),
'tenant': fields.StringField(),
'status': fields.StringField(nullable=True),
'status_reason': fields.StringField(nullable=True),
'created_at': fields.DateTimeField(read_only=True),

View File

@ -29,7 +29,7 @@ class SoftwareConfig(base.VersionedObject,
base.VersionedObjectDictCompat,
base.ComparableVersionedObject):
fields = {
'id': fields.StringField(nullable=False),
'id': fields.StringField(),
'name': fields.StringField(nullable=True),
'group': fields.StringField(nullable=True),
'tenant': fields.StringField(nullable=True),

View File

@ -30,12 +30,12 @@ class SoftwareDeployment(base.VersionedObject,
base.VersionedObjectDictCompat,
base.ComparableVersionedObject):
fields = {
'id': fields.StringField(nullable=False),
'config_id': fields.StringField(nullable=False),
'server_id': fields.StringField(nullable=False),
'id': fields.StringField(),
'config_id': fields.StringField(),
'server_id': fields.StringField(),
'input_values': heat_fields.JsonField(nullable=True),
'output_values': heat_fields.JsonField(nullable=True),
'tenant': fields.StringField(nullable=False),
'tenant': fields.StringField(),
'stack_user_project_id': fields.StringField(nullable=True),
'action': fields.StringField(nullable=True),
'status': fields.StringField(nullable=True),

View File

@ -26,9 +26,9 @@ from heat.objects import fields as heat_fields
class WatchData(base.VersionedObject, base.VersionedObjectDictCompat):
fields = {
'id': fields.IntegerField(nullable=False),
'id': fields.IntegerField(),
'data': heat_fields.JsonField(nullable=True),
'watch_rule_id': fields.StringField(nullable=False),
'watch_rule_id': fields.StringField(),
'watch_rule': fields.ObjectField('WatchRule'),
'created_at': fields.DateTimeField(read_only=True),
'updated_at': fields.DateTimeField(nullable=True),

View File

@ -28,12 +28,12 @@ from heat.objects import watch_data
class WatchRule(base.VersionedObject, base.VersionedObjectDictCompat):
fields = {
'id': fields.IntegerField(nullable=False),
'id': fields.IntegerField(),
'name': fields.StringField(nullable=True),
'rule': heat_fields.JsonField(nullable=True),
'state': fields.StringField(nullable=True),
'last_evaluated': fields.DateTimeField(nullable=True),
'stack_id': fields.StringField(nullable=False),
'stack_id': fields.StringField(),
'stack': fields.ObjectField(stack.Stack),
'watch_data': fields.ListOfObjectsField(watch_data.WatchData),
'created_at': fields.DateTimeField(read_only=True),