Skip to content

Commit

Permalink
Add several minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardparis committed Oct 24, 2016
1 parent 8de5618 commit efb6bc1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions api/bw/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_bw_detail_ok(self, mock_get_project_list, mock_is_valid_request):
mock_get_project_list.return_value = {'0123456789abcdef': 'tenantA', 'abcdef0123456789': 'tenantB'}

project_policy_key = '0123456789abcdef:2'
request = self.factory.get('/bw/slas/' + project_policy_key)
request = self.factory.get('/bw/sla/' + project_policy_key)
response = bw_detail(request, project_policy_key)
self.assertEqual(response.status_code, status.HTTP_200_OK)
json_data = json.loads(response.content)
Expand All @@ -127,13 +127,13 @@ def test_update_sla_ok(self, mock_get_project_list, mock_is_valid_request):

project_policy_key = '0123456789abcdef:2'
sla_data = {'bandwidth': '10000'}
request = self.factory.put('/bw/slas/' + project_policy_key, sla_data, format='json')
request = self.factory.put('/bw/sla/' + project_policy_key, sla_data, format='json')
response = bw_detail(request, project_policy_key)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

# Verify the SLA was updated
mock_get_project_list.return_value = {'0123456789abcdef': 'tenantA', 'abcdef0123456789': 'tenantB'}
request = self.factory.get('/bw/slas/' + project_policy_key)
request = self.factory.get('/bw/sla/' + project_policy_key)
response = bw_detail(request, project_policy_key)
self.assertEqual(response.status_code, status.HTTP_200_OK)
json_data = json.loads(response.content)
Expand All @@ -145,7 +145,7 @@ def test_delete_sla_ok(self, mock_get_project_list, mock_is_valid_request):

mock_is_valid_request.return_value = 'fake_token'
project_policy_key = '0123456789abcdef:2'
request = self.factory.delete('/bw/slas/' + project_policy_key)
request = self.factory.delete('/bw/sla/' + project_policy_key)
response = bw_detail(request, project_policy_key)
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)

Expand Down
6 changes: 3 additions & 3 deletions api/filters/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
url(r'^/(?P<account>\w+)/(?P<container>[-\w]+)/(?P<swift_object>[-\w]+)/deploy/(?P<filter_id>[0-9]+)/?$', views.filter_deploy),

# Undeploy to tenant container or object
# url(r'^/(?P<account>\w+)/undeploy/(?P<filter_id>[0-9]+)/?$', views.filter_undeploy),
# url(r'^/(?P<account>\w+)/(?P<container>[-\w]+)/undeploy/(?P<filter_id>[0-9]+)/?$', views.filter_undeploy),
# url(r'^/(?P<account>\w+)/(?P<container>[-\w]+)/(?P<swift_object>[-\w]+)/undeploy/(?P<filter_id>[0-9]+)/?$', views.filter_undeploy),
url(r'^/(?P<account>\w+)/undeploy/(?P<filter_id>[0-9]+)/?$', views.filter_undeploy),
url(r'^/(?P<account>\w+)/(?P<container>[-\w]+)/undeploy/(?P<filter_id>[0-9]+)/?$', views.filter_undeploy),
url(r'^/(?P<account>\w+)/(?P<container>[-\w]+)/(?P<swift_object>[-\w]+)/undeploy/(?P<filter_id>[0-9]+)/?$', views.filter_undeploy),

url(r'^/dependencies/?$', views.dependency_list),
url(r'^/dependencies/(?P<dependency_id>\w+)/?$', views.dependency_detail),
Expand Down
2 changes: 1 addition & 1 deletion api/filters/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def storlet_list_deployed(request, account):
@csrf_exempt
def filter_undeploy(request, filter_id, account, container=None, swift_object=None):
"""
Undeploy a storlet from a specific swift account.
Undeploy a filter from a specific swift account.
"""
# Validate request: only admin user can access to this method
token = is_valid_request(request)
Expand Down
2 changes: 1 addition & 1 deletion api/registry/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def add_dynamic_filter(request):
if not name:
return JSONResponse('Filter must have a name', status=400)
r.hmset('dsl_filter:' + str(name), data)
return JSONResponse('Filter has been added in the registy', status=201)
return JSONResponse('Filter has been added to the registy', status=201)
return JSONResponse('Method ' + str(request.method) + ' not allowed.', status=405)


Expand Down
2 changes: 1 addition & 1 deletion api/swift/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def storage_policies(request):
return JSONResponse('Error creating the Storage Policy: ' + e, status=status.HTTP_500_INTERNAL_SERVER_ERROR)

return JSONResponse('Account created successfully', status=status.HTTP_201_CREATED)
return JSONResponse('Only HTTP POST /spolicies/ requests allowed.', status=status.HTTP_405_METHOD_NOT_ALLOWED)
return JSONResponse('Only HTTP POST requests allowed.', status=status.HTTP_405_METHOD_NOT_ALLOWED)


@csrf_exempt
Expand Down
3 changes: 3 additions & 0 deletions puppet/manifests/default.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
"python-swiftclient":
ensure => "installed",
provider => pip;
"python-keystoneclient":
ensure => "installed",
provider => pip;
"redis":
ensure => "installed",
provider => pip;
Expand Down

0 comments on commit efb6bc1

Please sign in to comment.