Project

General

Profile

Fix #6498

fix Serializer to report new _unix fields

Added by Dan Mick almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

--- ceph/serializers.py    2013-10-10 00:23:26.123011002 -0700
+++ /home/ubuntu/calamari/webapp/calamari/ceph/serializers.py    2013-10-09 18:54:01.550286103 -0700
@@ -7,27 +7,19 @@
 from ceph.management.commands.ceph_refresh import CephRestClient

 class ClusterSerializer(serializers.ModelSerializer):
-    cluster_update_time_unix = serializers.SerializerMethodField('get_cluster_update_time_unix')
-    cluster_update_attempt_time_unix = serializers.SerializerMethodField('get_cluster_update_attempt_time_unix')
     class Meta:
         model = Cluster
         fields = ('id', 'name', 'api_base_url',
-              'cluster_update_time', 'cluster_update_time_unix', 
+              'cluster_update_time', 'cluster_update_time_unix',
               'cluster_update_attempt_time', 'cluster_update_attempt_time_unix',
               'cluster_update_error_msg', 'cluster_update_error_isclient')

         # only kraken updates this stuff. we don't want to expose it through
         # the rest API, so these read-only fields won't be altered.
-        read_only_fields = ('cluster_update_time',
-                'cluster_update_attempt_time',
+        read_only_fields = ('cluster_update_time', 'cluster_update_time_unix',
+                'cluster_update_attempt_time', 'cluster_update_attempt_time_unix',
                 'cluster_update_error_msg', 'cluster_update_error_isclient')

-    def get_cluster_update_time_unix(self, obj):
-        return obj.cluster_update_time_unix
-
-    def get_cluster_update_attempt_time_unix(self, obj):
-        return obj.cluster_update_attempt_time_unix
-
     def validate_api_base_url(self, attrs, source):
         try:
             client = CephRestClient(attrs[source])

Related issues

Related to Calamari - Fix #6497: BE: fix CephRestClient api change in cluster communication test Duplicate 10/09/2013

Associated revisions

Revision d64c0555 (diff)
Added by Dan Mick almost 8 years ago

ceph/serializers.py: update for _unix timestamp generated fields

Fixes: #6498
Signed-off-by: Dan Mick <>

History

#1 Updated by Dan Mick almost 8 years ago

  • Status changed from New to Fix Under Review
  • Assignee set to Dan Mick

#2 Updated by Dan Mick almost 8 years ago

  • Tracker changed from Bug to Fix
  • Status changed from Fix Under Review to Resolved
  • Target version set to v1.0rc-1

#3 Updated by Dan Mick almost 8 years ago

  • translation missing: en.field_story_points set to 1.0

Also available in: Atom PDF