Skip to content

Commit 60675bb

Browse files
authored
Use cloud helpers in stress command to provide credentials automatically (#2139)
The stress command was missing the setup_cloud_environment/cleanup_cloud_environment integration that other OpenStack commands (compute, volume, etc.) already use. This caused "password is a required attribute" errors because the subprocess could not find credentials from secrets.yml or secure.yml. AI-assisted: Claude Code Signed-off-by: Christian Berendt <berendt@osism.tech>
1 parent 773c323 commit 60675bb

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

osism/commands/stress.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,19 @@ def get_parser(self, prog_name):
155155
def take_action(self, parsed_args):
156156
"""Execute the OpenStack stress testing tool"""
157157

158+
from osism.tasks.openstack import get_cloud_helpers
159+
160+
setup_cloud_environment, _, cleanup_cloud_environment = get_cloud_helpers()
161+
162+
_, temp_files, original_cwd, success = setup_cloud_environment(
163+
parsed_args.cloud
164+
)
165+
if not success:
166+
logger.error(
167+
f"Failed to set up cloud environment for '{parsed_args.cloud}'"
168+
)
169+
return 1
170+
158171
# Build the command
159172
command = [
160173
"python3",
@@ -199,7 +212,6 @@ def take_action(self, parsed_args):
199212
f"Executing OpenStack stress test with command: {' '.join(command)}"
200213
)
201214

202-
# Execute the stress tool
203215
try:
204216
result = subprocess.run(command, check=False)
205217
return result.returncode
@@ -211,3 +223,5 @@ def take_action(self, parsed_args):
211223
except Exception as e:
212224
logger.error(f"Error executing OpenStack stress tool: {e}")
213225
return 1
226+
finally:
227+
cleanup_cloud_environment(temp_files, original_cwd)

0 commit comments

Comments
 (0)