Optimizing some logic in the code when creating pod
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Tricircle |
Fix Released
|
Medium
|
zhangyanxian |
Bug Description
so many if branch for the az_name in pod.py as following:
63 if az_name == '' and region_name == '':
64 return Response(_('Valid region_name is required for top region'),
65 422)
66
67 if az_name != '' and region_name == '':
68 return Response(_('Valid region_name is required for pod'), 422)
69
70 if pod.get('az_name') is None:
71 if self._get_
72 return Response(_('Top region already exists'), 409)
73
74 # if az_name is not null, then the pod region name should not
75 # be same as that the top region
76 if az_name != '':
77 if (self._
78 region_name != ''):
79 return Response(
80 _('Pod region name duplicated with the top region name'),
81 409)
82
83 # to create the top region, make the pod_az_name to null value
84 if az_name == '':
85 pod_az_name = ''
Maybe we can optimize them to keep the logic more clearly
Changed in tricircle: | |
assignee: | nobody → zhangyanxian (zhang-yanxian) |
Changed in tricircle: | |
importance: | Undecided → Medium |
Fix proposed to branch: master /review. openstack. org/465827
Review: https:/