[PR #6296] [MERGED] [core]: create_lxc: better handling, fix lock handling, improve template validation & storage selection UX #6527

Closed
opened 2025-11-20 07:11:00 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/6296
Author: @MickLesk
Created: 7/28/2025
Status: Merged
Merged: 7/28/2025
Merged by: @MickLesk

Base: mainHead: create_lxc_storage_handling


📝 Commits (3)

📊 Changes

1 file changed (+64 additions, -63 deletions)

View changed files

📝 misc/create_lxc.sh (+64 -63)

📄 Description

✍️ Description

  • Lockfile Handling Fixed
    exec 9>"$lockfile" now correctly holds the lock; no longer exits silently.

  • Exit Trap Added
    Temporary files (e.g. lock) are cleaned up via on_exit.

  • Improved Template Validation
    Template is now checked via pveam, -s, and zstdcat | tar for integrity.

  • Retry Logic Refined
    Clear download retry loop with error message and proper exit code (208).

  • Enhanced Storage Selection
    Cancel is now respected; selected storage is shown with GB/TB usage.

  • Execution Flow Reorganized
    Storage check and validation occur earlier; prevents wasteful operations.

  • Better Output & Error Messages
    More user-friendly, consistent status and error reporting throughout.

image

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/6296 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 7/28/2025 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `create_lxc_storage_handling` --- ### 📝 Commits (3) - [`ee6d6b3`](https://github.com/community-scripts/ProxmoxVE/commit/ee6d6b3e006ba812dae87a5ad7a3aa7f3d781df9) Update create_lxc.sh - [`025417b`](https://github.com/community-scripts/ProxmoxVE/commit/025417b2d34ca1145f9d0ef51f334e4f385ca975) Update create_lxc.sh - [`43b392d`](https://github.com/community-scripts/ProxmoxVE/commit/43b392d4a303f3afef1f2d75e6e957997952e4f5) Update create_lxc.sh ### 📊 Changes **1 file changed** (+64 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `misc/create_lxc.sh` (+64 -63) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description - **Lockfile Handling Fixed** `exec 9>"$lockfile"` now correctly holds the lock; no longer exits silently. - **Exit Trap Added** Temporary files (e.g. lock) are cleaned up via `on_exit`. - **Improved Template Validation** Template is now checked via `pveam`, `-s`, and `zstdcat | tar` for integrity. - **Retry Logic Refined** Clear download retry loop with error message and proper exit code (`208`). - **Enhanced Storage Selection** Cancel is now respected; selected storage is shown with GB/TB usage. - **Execution Flow Reorganized** Storage check and validation occur earlier; prevents wasteful operations. - **Better Output & Error Messages** More user-friendly, consistent status and error reporting throughout. <img width="656" height="340" alt="image" src="https://github.com/user-attachments/assets/99f6f108-8577-497d-8836-56ee7e2ab305" /> ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [ ] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [x] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 07:11:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#6527