summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-12-14 18:51:33 +0000
committerGerrit Code Review <review@openstack.org>2018-12-14 18:51:33 +0000
commitdf76895de9a8afb9a6c7ef926fa85e7ed10e2843 (patch)
tree86d91b3b507de289cf990f014be393565824af74
parentd1e5526d8468b06cc62b81bf2158a565cac94a66 (diff)
parent7fe134264bcb57b8f58588276107a440c7dec63d (diff)
Merge "Convert NTP/PTP enabled flag to string implicitly in DC sync."
-rw-r--r--dcorch/drivers/openstack/sysinv_v1.py8
-rw-r--r--dcorch/engine/sync_services/sysinv.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/dcorch/drivers/openstack/sysinv_v1.py b/dcorch/drivers/openstack/sysinv_v1.py
index eb9b432..da71c69 100644
--- a/dcorch/drivers/openstack/sysinv_v1.py
+++ b/dcorch/drivers/openstack/sysinv_v1.py
@@ -170,11 +170,11 @@ class SysinvClient(base.DriverBase):
170 return intp 170 return intp
171 if ntpservers == "NC": 171 if ntpservers == "NC":
172 ntpservers = "" 172 ntpservers = ""
173 if intp.enabled != (enabled == "True") or \ 173 if str(intp.enabled) != enabled or \
174 not self._same_ntpservers(intp.ntpservers, ntpservers): 174 not self._same_ntpservers(intp.ntpservers, ntpservers):
175 if ntpservers == "": 175 if ntpservers == "":
176 ntpservers = "NC" 176 ntpservers = "NC"
177 patch = make_sysinv_patch({'enabled': str(enabled), 177 patch = make_sysinv_patch({'enabled': enabled,
178 'ntpservers': ntpservers, 178 'ntpservers': ntpservers,
179 'action': 'apply'}) 179 'action': 'apply'})
180 LOG.info("region={} ntp update uuid={} patch={}".format( 180 LOG.info("region={} ntp update uuid={} patch={}".format(
@@ -223,11 +223,11 @@ class SysinvClient(base.DriverBase):
223 LOG.warn("ptp not found %s" % self.region_name) 223 LOG.warn("ptp not found %s" % self.region_name)
224 return ptp 224 return ptp
225 225
226 if ptp.enabled != (enabled == "True") or \ 226 if str(ptp.enabled) != enabled or \
227 ptp.mode != mode or \ 227 ptp.mode != mode or \
228 ptp.transport != transport or \ 228 ptp.transport != transport or \
229 ptp.mechanism != mechanism: 229 ptp.mechanism != mechanism:
230 patch = make_sysinv_patch({'enabled': str(enabled), 230 patch = make_sysinv_patch({'enabled': enabled,
231 'mode': mode, 231 'mode': mode,
232 'transport': transport, 232 'transport': transport,
233 'mechanism': mechanism}) 233 'mechanism': mechanism})
diff --git a/dcorch/engine/sync_services/sysinv.py b/dcorch/engine/sync_services/sysinv.py
index 060afc5..43628cc 100644
--- a/dcorch/engine/sync_services/sysinv.py
+++ b/dcorch/engine/sync_services/sysinv.py
@@ -210,7 +210,7 @@ class SysinvSyncThread(SyncThread):
210 extra=self.log_extra) 210 extra=self.log_extra)
211 return 211 return
212 212
213 intp = self.update_ntp(enabled, ntpservers) 213 intp = self.update_ntp(str(enabled), ntpservers)
214 214
215 # Ensure subcloud resource is persisted to the DB for later 215 # Ensure subcloud resource is persisted to the DB for later
216 subcloud_rsrc_id = self.persist_db_subcloud_resource( 216 subcloud_rsrc_id = self.persist_db_subcloud_resource(
@@ -291,7 +291,7 @@ class SysinvSyncThread(SyncThread):
291 extra=self.log_extra) 291 extra=self.log_extra)
292 return 292 return
293 293
294 ptp = self.update_ptp(enabled, mode, transport, mechanism) 294 ptp = self.update_ptp(str(enabled), mode, transport, mechanism)
295 295
296 # Ensure subcloud resource is persisted to the DB for later 296 # Ensure subcloud resource is persisted to the DB for later
297 subcloud_rsrc_id = self.persist_db_subcloud_resource( 297 subcloud_rsrc_id = self.persist_db_subcloud_resource(