do not allow specs with zwsp characters

For some reason a number of specs (and docs) have zwsp characters
inserted in URLs. This causes crud in the reviews, and really
confusing errors around line lengths for people (we count them, but
they aren't seen in their editor).
This removes them and makes a test to make sure they never come back.
Change-Id: Ib6e94725e2716dbb2ff86f272fbe4a6987714444
This commit is contained in:
Sean Dague
2016年06月01日 14:42:38 -04:00
parent ed3fa63282
commit 4ed51d077e

View File

@@ -51,7 +51,7 @@ REST API impact
The method:
"/v2/{tenant_id}/servers/{server_id}"
"/v2/{tenant_id}/servers/{server_id}"
With the method type PUT.

View File

@@ -75,7 +75,7 @@ minimum supported version.
* 404: If the address on the request does not match a FixedIP entry in the
database.
* ``/v2.1/{tenant_id}/os-fixed-ips/{fixed_ip}``
* ``/v2.1/{tenant_id}/os-fixed-ips/{fixed_ip}``
* Parameters which can be passed via the url: The fixed IP address

View File

@@ -99,7 +99,7 @@ REST API impact
Change in should be added in a new API microversion:
`GET /v2.1/os-hypervisors/{hypervisor_id}`
`GET /v2.1/os-hypervisors/{hypervisor_id}`
Show hypervisor details
Shows details for a specified hypervisor.

View File

@@ -51,7 +51,7 @@ REST API impact
The method:
"/v2/{tenant_id}/servers/{server_id}"
"/v2/{tenant_id}/servers/{server_id}"
With the method type PUT.

View File

@@ -54,7 +54,7 @@ if log doesn't contain this offset response should be empty.
Request:
URL:
/v2.1/{tenant_id}/servers/{server_id}/action
/v2.1/{tenant_id}/servers/{server_id}/action
Method:

View File

@@ -99,7 +99,7 @@ REST API impact
Change in should be added in a new API microversion:
`GET /v2.1/os-hypervisors/{hypervisor_id}`
`GET /v2.1/os-hypervisors/{hypervisor_id}`
Show hypervisor details
Shows details for a specified hypervisor.

View File

@@ -96,6 +96,13 @@ class TestTitles(testtools.TestCase):
"Found %s literal carriage returns in file %s" %
(len(matches), tpl))
def _check_no_zwsp(self, tpl, raw):
matches = raw.decode('utf-8').find(u"\u200B")
self.assertEqual(
matches, -1,
"Found zero width space characters in file %s" %
(tpl))
def _check_trailing_spaces(self, tpl, raw):
for i, line in enumerate(raw.split("\n")):
trailing_spaces = re.findall(" +$", line)
@@ -124,4 +131,5 @@ class TestTitles(testtools.TestCase):
self._check_titles(filename, template_titles, titles)
self._check_lines_wrapping(filename, data)
self._check_no_cr(filename, data)
self._check_no_zwsp(filename, data)
self._check_trailing_spaces(filename, data)
Reference in New Issue
openstack/nova-specs
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.