From 116e74b92d64c6635aae5b6dbec9717f2f583129 Mon Sep 17 00:00:00 2001 From: Zhou Ya Date: Mon, 28 Nov 2016 09:37:26 +0800 Subject: [PATCH] transform ironic data format in update_host function we add ironic data format transform in add_host function but we forget to add ironic data format transform in update_host function Change-Id: I70dd2111dd9237cc4848ddffa8f0efecda425498 --- code/daisy/daisy/api/v1/hosts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/daisy/daisy/api/v1/hosts.py b/code/daisy/daisy/api/v1/hosts.py index d224a2ef..cd27f4c6 100644 --- a/code/daisy/daisy/api/v1/hosts.py +++ b/code/daisy/daisy/api/v1/hosts.py @@ -1793,6 +1793,12 @@ class Controller(controller.BaseController): self.add_ssh_host_to_cluster_and_assigned_network( req, host_meta['cluster'], id) + for ironic_keyword in ['cpu', 'system', 'memory', + 'pci', 'disks', 'devices']: + if host_meta.get(ironic_keyword): + host_meta[ironic_keyword] = eval( + host_meta.get(ironic_keyword)) + host_meta = registry.update_host_metadata(req.context, id, host_meta)