mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
update zoneinfo endpoint to be a list of dicts
This commit is contained in:
@@ -700,7 +700,10 @@ class ScheduleZoneInfo(APIView):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
from dateutil.zoneinfo import get_zonefile_instance
|
from dateutil.zoneinfo import get_zonefile_instance
|
||||||
return Response(sorted(get_zonefile_instance().zones.keys()))
|
return Response([
|
||||||
|
{'name': zone}
|
||||||
|
for zone in sorted(get_zonefile_instance().zones)
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
|
class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
|
||||||
|
|||||||
@@ -280,3 +280,10 @@ def test_dst_rollback_duplicates(post, admin_user):
|
|||||||
'2030-11-03 02:30:00-05:00',
|
'2030-11-03 02:30:00-05:00',
|
||||||
'2030-11-03 03:30:00-05:00',
|
'2030-11-03 03:30:00-05:00',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_zoneinfo(get, admin_user):
|
||||||
|
url = reverse('api:schedule_zoneinfo')
|
||||||
|
r = get(url, admin_user, expect=200)
|
||||||
|
assert {'name': 'America/New_York'} in r.data
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ A list of _valid_ zone identifiers (which can vary by system) can be found at:
|
|||||||
HTTP GET /api/v2/schedules/zoneinfo/
|
HTTP GET /api/v2/schedules/zoneinfo/
|
||||||
|
|
||||||
[
|
[
|
||||||
"Africa/Abidjan",
|
{"name": "Africa/Abidjan"},
|
||||||
"Africa/Accra",
|
{"name": "Africa/Accra"},
|
||||||
"Africa/Addis_Ababa",
|
{"name": "Africa/Addis_Ababa"},
|
||||||
...
|
...
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user