diff --git a/mixmatch/proxy.py b/mixmatch/proxy.py index d6592db..2001997 100644 --- a/mixmatch/proxy.py +++ b/mixmatch/proxy.py @@ -84,6 +84,7 @@ class RequestDetails(object): self.service = get_service(local_path) self.version = utils.safe_pop(local_path) self.project_id = utils.pop_if_uuid(local_path) + self.project_in_path = True if self.project_id else False self.action = local_path[:] # NOTE(knikolla): This includes self.resource_type = utils.safe_pop(local_path) # this self.resource_id = utils.pop_if_uuid(local_path) # and this @@ -194,7 +195,7 @@ class RequestHandler(object): self.details.service, self.details.version, self.details.action, - project_id=project_id + project_id=project_id if self.details.project_in_path else None ) request_kwargs = { diff --git a/mixmatch/tests/unit/test_volumes.py b/mixmatch/tests/unit/test_volumes.py index 4fa583a..427e879 100644 --- a/mixmatch/tests/unit/test_volumes.py +++ b/mixmatch/tests/unit/test_volumes.py @@ -392,6 +392,22 @@ class TestVolumesV2(base.BaseTest): self.assertEqual(response.get_data(as_text=True), fake_response) + def test_unversioned_call_no_action_no_aggregation_token(self): + self.config_fixture.load_raw_values(aggregation=False) + fake_response = uuid.uuid4().hex + + self.requests_fixture.get( + self._construct_url(sp='default'), + text=fake_response, + status_code=200, + request_headers=self.auth.get_headers(), + headers={'CONTENT-TYPE': 'application/json'}) + + response = self.app.get('volume', headers=self.auth.get_headers()) + self.assertEqual(response.status_code, 200) + self.assertEqual(response.get_data(as_text=True), + fake_response) + def test_volume_versioned_calls_no_action(self): response = self.app.get( '/volume/v2',