Skip to content

Commit fead61e

Browse files
committed
chore(controller): change process type names to ptypes
1 parent cae586a commit fead61e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

rootfs/api/tests/test_ptypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ def test_restart_ptypes(self, mock_requests):
101101
self.assertEqual(response.status_code, 204, response.data)
102102

103103
# restart web and workers ptype deployments
104-
body = {"types": "web,worker"}
104+
body = {"ptypes": "web,worker"}
105105
response = self.client.post('/v2/apps/{}/ptypes/restart'.format(app_id), body)
106106
self.assertEqual(response.status_code, 204, response.data)
107107

108108
# restart invalid ptypes
109-
body = {"types": "web1"}
109+
body = {"ptypes": "web1"}
110110
response = self.client.post('/v2/apps/{}/ptypes/restart'.format(app_id), body)
111111
self.assertEqual(response.status_code, 400, response.data)
112112

rootfs/api/tests/test_release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def test_release_deploy(self, mock_requests):
206206
# app.deploy
207207
with mock.patch('api.models.app.App.deploy') as mock_deploy:
208208
mock_deploy.return_value = None
209-
response = self.client.post(url, {"types": "web"})
209+
response = self.client.post(url, {"ptypes": "web"})
210210
self.assertEqual(response.status_code, 400)
211211

212212
# post a new build
@@ -225,7 +225,7 @@ def test_release_deploy(self, mock_requests):
225225
# app.deploy
226226
with mock.patch('api.models.app.App.deploy') as mock_deploy:
227227
mock_deploy.return_value = None
228-
response = self.client.post(url, {"types": "web"})
228+
response = self.client.post(url, {"ptypes": "web"})
229229
self.assertEqual(response.status_code, 204)
230230

231231
def test_release_rollback(self, mock_requests):

rootfs/api/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def describe(self, *args, **kwargs):
459459

460460
def restart(self, request, *args, **kwargs):
461461
app = self.get_app()
462-
ptypes = set([ptype for ptype in request.data.get("types", "").split(",") if ptype])
462+
ptypes = set([ptype for ptype in request.data.get("ptypes", "").split(",") if ptype])
463463
if not ptypes:
464464
ptypes = app.structure.keys() # all ptypes need to restart
465465
else:
@@ -639,7 +639,7 @@ def deploy(self, request, **kwargs):
639639
if release.deploying:
640640
raise DryccException('There is an executing pipeline, please wait')
641641
procfile_types = set(
642-
[ptype for ptype in request.data.get("types", "").split(",") if ptype])
642+
[ptype for ptype in request.data.get("ptypes", "").split(",") if ptype])
643643
if not procfile_types:
644644
procfile_types = release.app.structure.keys() # all procfile_types need to deploy
645645
else:

0 commit comments

Comments
 (0)