diff --git a/nova/api/openstack/compute/contrib/cloudpipe.py b/nova/api/openstack/compute/contrib/cloudpipe.py index 0f05f59c5c4..abae9bf06e3 100644 --- a/nova/api/openstack/compute/contrib/cloudpipe.py +++ b/nova/api/openstack/compute/contrib/cloudpipe.py @@ -81,8 +81,8 @@ def _get_all_cloudpipes(self, context): if pipelib.is_vpn_image(instance['image_ref']) and instance['vm_state'] != vm_states.DELETED] - def _get_cloudpipe_for_project(self, context, project_id): - """Get the cloudpipe instance for a project ID.""" + def _get_cloudpipe_for_project(self, context): + """Get the cloudpipe instance for a project from context.""" cloudpipes = self._get_all_cloudpipes(context) or [None] return cloudpipes[0] @@ -143,7 +143,7 @@ def create(self, req, body): context.user_id = 'project-vpn' context.is_admin = False context.roles = [] - instance = self._get_cloudpipe_for_project(context, project_id) + instance = self._get_cloudpipe_for_project(context) if not instance: try: result = self.cloudpipe.launch_vpn_instance(context) diff --git a/nova/api/openstack/compute/plugins/v3/cloudpipe.py b/nova/api/openstack/compute/plugins/v3/cloudpipe.py index a0eb192829c..5c4dd8c6fbb 100644 --- a/nova/api/openstack/compute/plugins/v3/cloudpipe.py +++ b/nova/api/openstack/compute/plugins/v3/cloudpipe.py @@ -61,8 +61,8 @@ def _get_all_cloudpipes(self, context): if pipelib.is_vpn_image(instance['image_ref']) and instance['vm_state'] != vm_states.DELETED] - def _get_cloudpipe_for_project(self, context, project_id): - """Get the cloudpipe instance for a project ID.""" + def _get_cloudpipe_for_project(self, context): + """Get the cloudpipe instance for a project from context.""" cloudpipes = self._get_all_cloudpipes(context) or [None] return cloudpipes[0] @@ -123,7 +123,7 @@ def create(self, req, body): context.user_id = 'project-vpn' context.is_admin = False context.roles = [] - instance = self._get_cloudpipe_for_project(context, project_id) + instance = self._get_cloudpipe_for_project(context) if not instance: try: result = self.cloudpipe.launch_vpn_instance(context)