Fix a typo in sort dictionary method name

This commit is contained in:
Arkadii Yakovets 2023-10-10 13:28:09 -07:00
parent d926de783b
commit 1b4e6296a3
No known key found for this signature in database
GPG Key ID: A8C7A6F08A664356
3 changed files with 9 additions and 9 deletions

View File

@ -236,7 +236,7 @@ def load_all_modules(limit=-1, full_details=False):
""" """
# Search for Modules # Search for Modules
from config import nettacker_paths from config import nettacker_paths
from core.utility import sort_dictonary from core.utility import sort_dictionary
if full_details: if full_details:
import yaml import yaml
module_names = {} module_names = {}
@ -260,7 +260,7 @@ def load_all_modules(limit=-1, full_details=False):
if len(module_names) == limit: if len(module_names) == limit:
module_names['...'] = {} module_names['...'] = {}
break break
module_names = sort_dictonary(module_names) module_names = sort_dictionary(module_names)
module_names['all'] = {} module_names['all'] = {}
return module_names return module_names
@ -273,7 +273,7 @@ def load_all_profiles(limit=-1):
Returns: Returns:
an array of all profile names an array of all profile names
""" """
from core.utility import sort_dictonary from core.utility import sort_dictionary
all_modules_with_details = load_all_modules(limit=limit, full_details=True) all_modules_with_details = load_all_modules(limit=limit, full_details=True)
profiles = {} profiles = {}
if '...' in all_modules_with_details: if '...' in all_modules_with_details:
@ -287,11 +287,11 @@ def load_all_profiles(limit=-1):
else: else:
profiles[tag].append(key) profiles[tag].append(key)
if len(profiles) == limit: if len(profiles) == limit:
profiles = sort_dictonary(profiles) profiles = sort_dictionary(profiles)
profiles['...'] = [] profiles['...'] = []
profiles['all'] = [] profiles['all'] = []
return profiles return profiles
profiles = sort_dictonary(profiles) profiles = sort_dictionary(profiles)
profiles['all'] = [] profiles['all'] = []
return profiles return profiles

View File

@ -563,7 +563,7 @@ def expand_step(step):
return [step] return [step]
def sort_dictonary(dictionary): def sort_dictionary(dictionary):
etc_flag = '...' in dictionary etc_flag = '...' in dictionary
if etc_flag: if etc_flag:
del dictionary['...'] del dictionary['...']

View File

@ -15,8 +15,8 @@ class UtilityTesting(unittest.TestCase):
This is the class that tests the utility module functions. This is the class that tests the utility module functions.
""" """
def test_sort_dictonary(self): def test_sort_dictionary(self):
"""Tests if the function sorts the input dictionary.""" """Tests if the function sorts the input dictionary."""
input_dict = { input_dict = {
'a': 1, 'a': 1,
'c': 3, 'c': 3,
@ -29,7 +29,7 @@ class UtilityTesting(unittest.TestCase):
'c': 3, 'c': 3,
'd': 23, 'd': 23,
} }
self.assertDictEqual(utility.sort_dictonary(input_dict), sorted_dict) self.assertDictEqual(utility.sort_dictionary(input_dict), sorted_dict)
def test_select_maximum_cpu_core(self): def test_select_maximum_cpu_core(self):
"""Tests if it selects the proper amount of cpu's""" """Tests if it selects the proper amount of cpu's"""