From 11cb47c03e80cc2c8d19c8ad4d6c4db839d1d0f5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 5 Jul 2023 16:18:49 -0400 Subject: [PATCH] Use natural sort on some self service calls --- confluent_server/confluent/selfservice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/selfservice.py b/confluent_server/confluent/selfservice.py index f996620e..9000beb4 100644 --- a/confluent_server/confluent/selfservice.py +++ b/confluent_server/confluent/selfservice.py @@ -402,7 +402,7 @@ def handle_request(env, start_response): yield node + '\n' else: start_response('200 OK', (('Content-Type', retype),)) - yield dumper(sorted(nodes)) + yield dumper(list(util.natural_sort(nodes))) elif env['PATH_INFO'] == '/self/remoteconfigbmc' and reqbody: try: reqbody = yaml.safe_load(reqbody) @@ -570,7 +570,7 @@ def get_scriptlist(scriptcat, cfg, nodename, pathtemplate): if not os.path.isdir(target) and os.path.isdir(target + '.d'): target = target + '.d' try: - slist = sorted(os.listdir(target)) + slist = list(util.natural_sort(os.listdir(target)) except OSError: pass return slist, profile