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 ++++++++++++++++++++++ .../recipes-devtools/python/python-neutron_git.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-neutron/uuid_wscheck.patch (limited to 'meta-openstack/recipes-devtools/python') 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 + diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index 5fbad17..1314548 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb @@ -17,6 +17,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/icehouse \ file://metadata_agent.ini \ file://neutron-dhcp-agent-netns-cleanup.cron \ file://0001-neutron.conf-jumpstart-nova-state-reporting-configur.patch \ + file://uuid_wscheck.patch \ " SRCREV="e0deffc71e5031059530b9b6c2ef3b0765de3d10" PV="2014.1+git${SRCPV}" -- cgit v1.2.3-54-g00ecf