Skip to content

Commit

Permalink
#3526 error handled (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bharath-kandula authored Nov 16, 2023
1 parent 765ec5d commit ea631c1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/migrator/migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,8 @@ def notify_deployed(self):

try:
response = requests.post("https://api.rollbar.com/api/1/deploy/", data=data)
response_data = json.loads(response.text)

if response.status_code == 200 and response_data.get("result") == "success":
if response.status_code == 200:
print("Deployment recorded in Rollbar.")
subprocess.run(["python", "manage.py", "deployed"])
else:
Expand All @@ -222,7 +221,6 @@ def notify_deployed(self):

return MigrationResult.success()


STANDARD_MIGRATIONS: List[SubMigration] = [
CommandSubMigration.git(["pull"]).using(key="g", task_id="git*pull"),
CommandSubMigration.manage_py(["migrate"]).using(key="m", task_id="manage*migrate"),
Expand Down Expand Up @@ -254,7 +252,8 @@ def refresh_migrations(self):
with Popen(command, stdout=subprocess.PIPE) as proc:
# stdout_text = proc.stdout.read()
task_json = json.load(proc.stdout)
self.rollbar_token = task_json['ROLLBAR_ACCESS_TOKEN']
if token := task_json.get('ROLLBAR_ACCESS_TOKEN'):
self.rollbar_token = token
command = 1
for task in task_json["tasks"]:
self.has_custom_migrations = True
Expand Down

0 comments on commit ea631c1

Please sign in to comment.