Skip to content

Commit

Permalink
Handle group not exists (#1671)
Browse files Browse the repository at this point in the history
check group exist
  • Loading branch information
tylerwowen committed Jul 22, 2024
1 parent ae3864e commit b31ab1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deploy-board/deploy_board/webapp/group_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
hosts_helper, accounts_helper)
from diff_match_patch import diff_match_patch
from deploy_board import settings
from .helpers.exceptions import TeletraanException
from .helpers.exceptions import NotFoundException, TeletraanException

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -1198,6 +1198,8 @@ def get(self, request, group_name):
class GroupDetailView(View):
def get(self, request, group_name):
autoscaling_summary = autoscaling_groups_helper.get_autoscaling_summary(request, group_name)
if autoscaling_summary is None:
raise NotFoundException(f'Group {group_name} does not exist.')
asg_status = autoscaling_summary.get("status", "UNKNOWN")
enable_spot = autoscaling_summary.get("enableSpot", False)
envs = environs_helper.get_all_envs_by_group(request, group_name)
Expand Down

0 comments on commit b31ab1e

Please sign in to comment.