From 31bb8ba21d2e01a53679880f684bbc4f01255753 Mon Sep 17 00:00:00 2001 From: Deklan Dieterly Date: Mon, 1 Jun 2015 14:36:51 -0600 Subject: [PATCH] Always store value_meta If value_meta is null or blank, store an empty string. Change-Id: I6286d9b2f30b6ee6f8839c80c690721af09c5e75 --- .../persister/repository/influxdb/InfluxV9MetricRepo.java | 6 +++++- test-requirements.txt | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java b/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java index feb2e4f3..2435306b 100644 --- a/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java +++ b/java/src/main/java/monasca/persister/repository/influxdb/InfluxV9MetricRepo.java @@ -95,7 +95,11 @@ public class InfluxV9MetricRepo extends InfluxMetricRepo { String valueMetaJSONString = measurement.getValueMetaJSONString(); - if (valueMetaJSONString != null) { + if (valueMetaJSONString == null) { + + valueMap.put("value_meta", ""); + + } else { valueMap.put("value_meta", valueMetaJSONString); diff --git a/test-requirements.txt b/test-requirements.txt index eec19959..fc30489d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,3 @@ hacking>=0.9.2,<0.10 -pyflakes nose -mock>=1.0.1 +mock>=1.0.1 \ No newline at end of file