Skip to content

Commit 076c6c3

Browse files
Fix error with mmanager_opts placed incorrectly.
1 parent 86c5e0a commit 076c6c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/machinery/az.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ def set_options(self, options: dict) -> None:
109109
@param options: machine manager options dict.
110110
"""
111111
self.options = options
112-
mmanager_opts = self.options.get(self.module_name)
113-
if not isinstance(mmanager_opts["scale_sets"], list):
114-
mmanager_opts["scale_sets"] = str(mmanager_opts["scale_sets"]).strip().split(",")
115112

116113
def _initialize(self):
117114
"""
@@ -120,6 +117,11 @@ def _initialize(self):
120117
@param module_name: module name
121118
@raise CuckooDependencyError: if there is a problem with the dependencies call
122119
"""
120+
# Using "scale_sets" here instead of "machines" to avoid KeyError
121+
mmanager_opts = self.options.get(self.module_name)
122+
if not isinstance(mmanager_opts["scale_sets"], list):
123+
mmanager_opts["scale_sets"] = str(mmanager_opts["scale_sets"]).strip().split(",")
124+
123125
# Replace a list of IDs with dictionary representations
124126
scale_sets = mmanager_opts.pop("scale_sets")
125127
mmanager_opts["scale_sets"] = {}

0 commit comments

Comments
 (0)