diff --git a/pmm_psmdb-pbm_setup/Dockerfile b/pmm_psmdb-pbm_setup/Dockerfile index bca3144..d6f8df2 100644 --- a/pmm_psmdb-pbm_setup/Dockerfile +++ b/pmm_psmdb-pbm_setup/Dockerfile @@ -48,22 +48,22 @@ RUN set -ex; \ percona-server-mongodb-server-${PSMDB_VERSION}.el9 \ percona-server-mongodb-mongos-${PSMDB_VERSION}.el9 ; \ fi && \ - if [ $PBM_VERSION == "latest" ]; then \ + if [ "$PBM_VERSION" == "latest" ]; then \ yum -y install percona-backup-mongodb ; \ else \ yum -y install percona-backup-mongodb-${PBM_VERSION}.el9 ; \ fi -RUN if [[ $PMM_CLIENT_VERSION == http* ]]; then \ +RUN if [[ "$PMM_CLIENT_VERSION" == http* ]]; then \ yum -y install pmm-client && \ curl -Lf -o /tmp/pmm-client.tar.gz $PMM_CLIENT_VERSION && \ cd /tmp && tar -xvf pmm-client.tar.gz --transform 's,^/*[^/]*,/pmm-client,S' && \ cd /tmp/pmm-client && ./install_tarball && cd ../ && rm -rf pmm* ;\ elif [[ "$PMM_CLIENT_VERSION" =~ 3-dev-latest|latest ]]; then \ yum -y install pmm-client ; \ - elif [[ $PMM_CLIENT_VERSION =~ pmm3-rc ]]; then \ - percona-release enable original testing \ - yum update --refresh -y \ + elif [[ "$PMM_CLIENT_VERSION" = "pmm3-rc" ]]; then \ + percona-release enable original testing && \ + yum update --refresh -y && \ yum -y install pmm-client ; \ else \ yum -y install pmm-client-${PMM_CLIENT_VERSION}-6.el9 ; \ diff --git a/pmm_qa/pmm-framework.py b/pmm_qa/pmm-framework.py index 73c4e41..a7a1602 100755 --- a/pmm_qa/pmm-framework.py +++ b/pmm_qa/pmm-framework.py @@ -346,7 +346,7 @@ def execute_shell_scripts(shell_scripts, project_relative_scripts_dir, env_vars, # Execute each shell script for script in shell_scripts: - result = '' + result: subprocess.CompletedProcess try: print(f'running script {script}') # Change directory to where the script is located @@ -355,20 +355,13 @@ def execute_shell_scripts(shell_scripts, project_relative_scripts_dir, env_vars, result = subprocess.run(['bash', script], capture_output=True, text=True, check=True) print("Output:") print(result.stdout) + print(f"Shell script '{script}' executed successfully.") except subprocess.CalledProcessError as e: - print("Error:") - print(e.stderr) + print(f"Shell script '{script}' failed with return code: {e.returncode}! \n {e.stderr} \n Output: \n {e.stdout} ") + exit(e.returncode) except Exception as e: print("Unexpected error occurred:", e) finally: - # Get the return code of the process - return_code = result.returncode - if return_code == 0: - print(f"Shell script '{script}' executed successfully.") - else: - print(f"Shell script '{script}' failed with return code: {return_code}! \n {result.stderr}") - exit(return_code) - # Return to the original working directory os.chdir(original_dir) @@ -639,4 +632,4 @@ def setup_database(db_type, db_version=None, db_config=None, args=None): except Exception as e: print("An unexpected error occurred:", e) parser.print_help() - exit(1) + exit(1) \ No newline at end of file