From 2833e627e8a3bf679260165e5631e7597bf81173 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Mon, 23 Jun 2014 11:45:12 -0400 Subject: neutron: update uuid check error message If the uuid specified has trailing whitespace, update the error message to suggest that this is the case. (ie give a more useful error message) Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- .../python/python-neutron/uuid_wscheck.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-neutron/uuid_wscheck.patch (limited to 'meta-openstack/recipes-devtools/python/python-neutron') diff --git a/meta-openstack/recipes-devtools/python/python-neutron/uuid_wscheck.patch b/meta-openstack/recipes-devtools/python/python-neutron/uuid_wscheck.patch new file mode 100644 index 0000000..f3748d6 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-neutron/uuid_wscheck.patch @@ -0,0 +1,35 @@ +Binary files git.orig/neutron/api/v2/.attributes.py.swp and git/neutron/api/v2/.attributes.py.swp differ +Index: git/neutron/api/v2/attributes.py +=================================================================== +--- git.orig/neutron/api/v2/attributes.py ++++ git/neutron/api/v2/attributes.py +@@ -354,7 +354,10 @@ + + def _validate_uuid(data, valid_values=None): + if not uuidutils.is_uuid_like(data): +- msg = _("'%s' is not a valid UUID") % data ++ if data != data.rstrip(): ++ msg = _("'%s' is not a valid UUID: trailing whitespace?") % data ++ else: ++ msg = _("'%s' is not a valid UUID") % data + LOG.debug(msg) + return msg + +Index: git/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py +=================================================================== +--- git.orig/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py ++++ git/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py +@@ -569,8 +569,11 @@ + raise n_exc.InvalidInput(error_message=msg) + pair_list.append((segment, dot1qtag)) + else: +- LOG.debug(_('%s is not a valid uuid'), segment) +- msg = _("'%s' is not a valid UUID") % segment ++ if segment != segment.rstrip(): ++ msg = _("'%s' is not a valid UUID: trailing whitespace?") % segment ++ else: ++ msg = _("'%s' is not a valid UUID") % segment ++ LOG.debug(msg) + raise n_exc.InvalidInput(error_message=msg) + return pair_list + -- cgit v1.2.3-54-g00ecf