Skip to content

Commit cfcb252

Browse files
authored
Fix for 'used-before-assignment' (#106)
1 parent 1fbba22 commit cfcb252

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ disable = [
9898
"too-many-statements",
9999
"unexpected-keyword-arg",
100100
"unused-argument",
101-
"used-before-assignment",
102101
]
103102

104103
[tool.pytest]

src/pytest_ansible/module_dispatcher/v212.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def _run(self, *module_args, **complex_args):
148148
"passwords": {"conn_pass": None, "become_pass": None},
149149
}
150150

151+
kwargs_extra = {}
151152
# If we have an extra inventory, do the same that we did for the inventory
152153
if "extra_inventory_manager" in self.options:
153154
cb_extra = ResultAccumulator()
@@ -182,6 +183,8 @@ def _run(self, *module_args, **complex_args):
182183
variable_manager=self.options["variable_manager"],
183184
loader=self.options["loader"],
184185
)
186+
187+
play_extra = None
185188
if "extra_inventory_manager" in self.options:
186189
play_extra = Play().load(
187190
play_ds,

src/pytest_ansible/module_dispatcher/v213.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def _run(self, *module_args, **complex_args):
162162
"passwords": {"conn_pass": None, "become_pass": None},
163163
}
164164

165+
kwargs_extra = {}
165166
# If we have an extra inventory, do the same that we did for the inventory
166167
if "extra_inventory_manager" in self.options:
167168
cb_extra = ResultAccumulator()
@@ -196,6 +197,7 @@ def _run(self, *module_args, **complex_args):
196197
variable_manager=self.options["variable_manager"],
197198
loader=self.options["loader"],
198199
)
200+
play_extra = None
199201
if "extra_inventory_manager" in self.options:
200202
play_extra = Play().load(
201203
play_ds,

src/pytest_ansible/module_dispatcher/v29.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def _run(self, *module_args, **complex_args):
145145
"passwords": {"conn_pass": None, "become_pass": None},
146146
}
147147

148+
kwargs_extra = {}
148149
# If we have an extra inventory, do the same that we did for the inventory
149150
if "extra_inventory_manager" in self.options:
150151
cb_extra = ResultAccumulator()
@@ -179,6 +180,7 @@ def _run(self, *module_args, **complex_args):
179180
variable_manager=self.options["variable_manager"],
180181
loader=self.options["loader"],
181182
)
183+
play_extra = None
182184
if "extra_inventory_manager" in self.options:
183185
play_extra = Play().load(
184186
play_ds,

0 commit comments

Comments
 (0)