From 7a6a6bf69a6c3652859ab110c9fb70c270e45f5d Mon Sep 17 00:00:00 2001 From: Kaifeng Wang Date: Mon, 18 Feb 2019 15:43:00 +0800 Subject: [PATCH] Follow up to node description The patch fixes several comments left in the node description patch [1]. [1] https://review.openstack.org/#/c/632673 Change-Id: I3b4f4faa205e50c1dccb76e21ac54b17342cd486 Story: 2003089 Task: 23178 --- doc/source/contributor/webapi-version-history.rst | 2 +- ironic/api/controllers/v1/node.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/contributor/webapi-version-history.rst b/doc/source/contributor/webapi-version-history.rst index f8ce878734..bb693f74ce 100644 --- a/doc/source/contributor/webapi-version-history.rst +++ b/doc/source/contributor/webapi-version-history.rst @@ -38,7 +38,7 @@ Also added a new field ``allocation_uuid`` to the node resource. -------------------- Added ``description`` field to the node object to enable operators to store -any information relates to the node. The field is up to 4096 characters. +any information relates to the node. The field is limited to 4096 characters. 1.50 (Stein, master) -------------------- diff --git a/ironic/api/controllers/v1/node.py b/ironic/api/controllers/v1/node.py index f9531cad2d..41fddd606e 100644 --- a/ironic/api/controllers/v1/node.py +++ b/ironic/api/controllers/v1/node.py @@ -2029,7 +2029,7 @@ class NodesController(rest.RestController): if (node.description is not wtypes.Unset and len(node.description) > _NODE_DESCRIPTION_MAX_LENGTH): - msg = _("Cannot create node with description exceeds %s " + msg = _("Cannot create node with description exceeding %s " "characters") % _NODE_DESCRIPTION_MAX_LENGTH raise exception.Invalid(msg) @@ -2095,7 +2095,7 @@ class NodesController(rest.RestController): description = api_utils.get_patch_values(patch, '/description') if description and len(description[0]) > _NODE_DESCRIPTION_MAX_LENGTH: - msg = _("Cannot create node with description exceeds %s " + msg = _("Cannot update node with description exceeding %s " "characters") % _NODE_DESCRIPTION_MAX_LENGTH raise exception.Invalid(msg)