Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a typo in sort dictionary method name #749

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions core/load_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def load_all_modules(limit=-1, full_details=False):
"""
# Search for Modules
from config import nettacker_paths
from core.utility import sort_dictonary
from core.utility import sort_dictionary
if full_details:
import yaml
module_names = {}
Expand All @@ -260,7 +260,7 @@ def load_all_modules(limit=-1, full_details=False):
if len(module_names) == limit:
module_names['...'] = {}
break
module_names = sort_dictonary(module_names)
module_names = sort_dictionary(module_names)
module_names['all'] = {}

return module_names
Expand All @@ -273,7 +273,7 @@ def load_all_profiles(limit=-1):
Returns:
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)
profiles = {}
if '...' in all_modules_with_details:
Expand All @@ -287,11 +287,11 @@ def load_all_profiles(limit=-1):
else:
profiles[tag].append(key)
if len(profiles) == limit:
profiles = sort_dictonary(profiles)
profiles = sort_dictionary(profiles)
profiles['...'] = []
profiles['all'] = []
return profiles
profiles = sort_dictonary(profiles)
profiles = sort_dictionary(profiles)
profiles['all'] = []
return profiles

Expand Down
2 changes: 1 addition & 1 deletion core/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def expand_step(step):
return [step]


def sort_dictonary(dictionary):
def sort_dictionary(dictionary):
etc_flag = '...' in dictionary
if etc_flag:
del dictionary['...']
Expand Down
6 changes: 3 additions & 3 deletions tests/core/utility.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class UtilityTesting(unittest.TestCase):
This is the class that tests the utility module functions.
"""

def test_sort_dictonary(self):
"""Tests if the function sorts the input dictionary."""
def test_sort_dictionary(self):
"""Tests if the function sorts the input dictionary."""
input_dict = {
'a': 1,
'c': 3,
Expand All @@ -29,7 +29,7 @@ def test_sort_dictonary(self):
'c': 3,
'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):
"""Tests if it selects the proper amount of cpu's"""
Expand Down