Skip to content

Instantly share code, notes, and snippets.

@mriedem
Created February 24, 2016 22:04
Show Gist options
  • Save mriedem/0026bf03804cba4c3b43 to your computer and use it in GitHub Desktop.
Save mriedem/0026bf03804cba4c3b43 to your computer and use it in GitHub Desktop.
diff --git a/nova/tests/functional/api/client.py b/nova/tests/functional/api/client.py
index db4d58c..fed8172 100644
--- a/nova/tests/functional/api/client.py
+++ b/nova/tests/functional/api/client.py
@@ -169,7 +169,16 @@ class TestOpenStackClient(object):
headers = kwargs.setdefault('headers', {})
headers['X-Auth-Token'] = auth_result['x-auth-token']
if self.microversion:
+ if ('X-OpenStack-Nova-API-Version' in headers and
+ headers['X-OpenStack-Nova-API-Version'] != \
+ self.microversion):
+ raise Exception('Invalid to set X-OpenStack-Nova-API-Version '
+ 'in headers and also as microversion '
+ 'attribute when the values are different.')
headers['X-OpenStack-Nova-API-Version'] = self.microversion
+ elif 'X-OpenStack-Nova-API-Version' in headers:
+ raise Exception('Set X-OpenStack-Nova-API-Version header using '
+ 'microversion attribute on api client.')
response = self.request(full_uri, **kwargs)
user@xubuntu:~/git/nova$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment