lib/elasticity/cluster_status.rb in elasticity-6.0.1 vs lib/elasticity/cluster_status.rb in elasticity-6.0.2
- old
+ new
@@ -18,12 +18,12 @@
ClusterStatus.new.tap do |c|
c.name = cluster_data['Name']
c.cluster_id = cluster_data['Id']
c.state = cluster_data['Status']['State']
c.created_at = Time.at(cluster_data['Status']['Timeline']['CreationDateTime'])
- c.ready_at = Time.at(cluster_data['Status']['Timeline']['ReadyDateTime'])
- c.ended_at = Time.at(cluster_data['Status']['Timeline']['EndDateTime'])
+ c.ready_at = cluster_data['Status']['Timeline']['ReadyDateTime'] ? Time.at(cluster_data['Status']['Timeline']['ReadyDateTime']) : nil
+ c.ended_at = cluster_data['Status']['Timeline']['EndDateTime'] ? Time.at(cluster_data['Status']['Timeline']['EndDateTime']) : nil
c.last_state_change_reason = cluster_data['Status']['StateChangeReason']['Code']
c.master_public_dns_name = cluster_data['MasterPublicDnsName']
c.normalized_instance_hours = cluster_data['NormalizedInstanceHours']
end
end
@@ -33,6 +33,6 @@
%w{RUNNING STARTING BOOTSTRAPPING WAITING SHUTTING_DOWN}.include?(@state)
end
end
-end
\ No newline at end of file
+end