Skip to content

Commit

Permalink
Remove unuseful parameter in cloudpipe api(v2/v2.1)
Browse files Browse the repository at this point in the history
project_id in _get_cloudpipe_for_project is useless, remove it.

Change-Id: Ie8cb7a6d8ce0678f04200c9fa9de58b4c92bd40d
  • Loading branch information
Eli Qiao committed Oct 21, 2014
1 parent 9fd059b commit 438f4d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions nova/api/openstack/compute/contrib/cloudpipe.py
Expand Up @@ -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]

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions nova/api/openstack/compute/plugins/v3/cloudpipe.py
Expand Up @@ -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]

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 438f4d1

Please sign in to comment.