Allow to update 'v2.1' links in sample files

Currently logic in _update_links() will update the 'v2'
versions in sample files links, we should have that logic
to update both 'v2.1' and 'v2' versions in links.

If there will be 'v2.1' versions in links, current logic
will find 'v2' in 'v2.1' text and replace it with 'v2.1'
and 'v2.1.1' for v2 and v2.1 scenario tests respectively.

This is needed to makes sample files in doc/api_samples
with 'v2.1' in links.

Change-Id: Id2d37520cc72bc5539b5f000b80c301d1fa7e3f5
This commit is contained in:
Ghanshyam 2015-12-15 13:18:30 +09:00 committed by Ghanshyam Mann
parent aaf6ab4b78
commit 050e691948
1 changed files with 1 additions and 1 deletions

View File

@ -248,7 +248,7 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
def _update_links(self, sample_data):
"""Process sample data and update version specific links."""
url_re = self._get_host() + "/v(2|2\.1)"
url_re = self._get_host() + "/v(2\.1|2)"
new_url = self._get_host() + "/" + self.api_major_version
updated_data = re.sub(url_re, new_url, sample_data)
return updated_data