Skip to content

Commit b670426

Browse files
committed
remove debugf and duplicate codes
1 parent f468ee8 commit b670426

File tree

3 files changed

+6
-41
lines changed

3 files changed

+6
-41
lines changed

misc/alpine-tools.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/ash
22
# shellcheck shell=ash
33

4-
# Erwartet vorhandene msg_* und optional $STD aus deinem Framework.
4+
# Expects existing msg_* functions and optional $STD from the framework.
55

66
# ------------------------------
77
# helpers

misc/build.func

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ if command -v curl >/dev/null 2>&1; then
8787
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
8888
load_functions
8989
catch_errors
90-
#echo "(build.func) Loaded core.func via curl"
9190
elif command -v wget >/dev/null 2>&1; then
9291
source <(wget -qO- https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
9392
source <(wget -qO- https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
@@ -2242,7 +2241,7 @@ build_container() {
22422241
esac
22432242
fi
22442243

2245-
# IP (immer zwingend, Standard dhcp)
2244+
# IP (always required, default dhcp)
22462245
NET_STRING+=",ip=${NET:-dhcp}"
22472246

22482247
# Gateway
@@ -2834,12 +2833,12 @@ destroy_lxc() {
28342833
return 1
28352834
fi
28362835

2837-
# Abbruch bei Ctrl-C / Ctrl-D / ESC
2836+
# Abort on Ctrl-C / Ctrl-D / ESC
28382837
trap 'echo; msg_error "Aborted by user (SIGINT/SIGQUIT)"; return 130' INT QUIT
28392838

28402839
local prompt
28412840
if ! read -rp "Remove this Container? <y/N> " prompt; then
2842-
# read gibt != 0 zurück bei Ctrl-D/ESC
2841+
# read returns non-zero on Ctrl-D/ESC
28432842
msg_error "Aborted input (Ctrl-D/ESC)"
28442843
return 130
28452844
fi
@@ -3555,16 +3554,6 @@ create_lxc_container() {
35553554

35563555
LOGFILE="/tmp/pct_create_${CTID}_$(date +%Y%m%d_%H%M%S)_${SESSION_ID}.log"
35573556

3558-
# # DEBUG: Show the actual command that will be executed
3559-
# echo "[DEBUG] ===== PCT CREATE COMMAND DETAILS ====="
3560-
# echo "[DEBUG] CTID: $CTID"
3561-
# echo "[DEBUG] Template: ${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE}"
3562-
# echo "[DEBUG] PCT_OPTIONS (will be word-split):"
3563-
# echo "$PCT_OPTIONS" | sed 's/^/ /'
3564-
# echo "[DEBUG] Full command line:"
3565-
# echo " pct create $CTID ${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE} $PCT_OPTIONS"
3566-
# echo "[DEBUG] ========================================"
3567-
35683557
msg_debug "pct create command: pct create $CTID ${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE} $PCT_OPTIONS"
35693558
msg_debug "Logfile: $LOGFILE"
35703559

@@ -3609,7 +3598,7 @@ create_lxc_container() {
36093598
0) : ;; # success - container created, continue
36103599
2)
36113600
echo "Upgrade was declined. Please update and re-run:
3612-
apt update && apt install --only-upgrade pve-container lxc-pve"
3601+
apt update && apt install --only-upgrade pve-container lxc-pve"
36133602
exit 231
36143603
;;
36153604
3)
@@ -3641,7 +3630,7 @@ create_lxc_container() {
36413630
0) : ;; # success - container created, continue
36423631
2)
36433632
echo "Upgrade was declined. Please update and re-run:
3644-
apt update && apt install --only-upgrade pve-container lxc-pve"
3633+
apt update && apt install --only-upgrade pve-container lxc-pve"
36453634
exit 231
36463635
;;
36473636
3)

misc/error_handler.func

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ explain_exit_code() {
9090
253) echo "MongoDB: Database not found" ;;
9191
254) echo "MongoDB: Fatal query error" ;;
9292

93-
# --- Proxmox Custom Codes ---
94-
200) echo "Custom: Failed to create lock file" ;;
95-
203) echo "Custom: Missing CTID variable" ;;
96-
204) echo "Custom: Missing PCT_OSTYPE variable" ;;
97-
205) echo "Custom: Invalid CTID (<100)" ;;
98-
206) echo "Custom: CTID already in use (check 'pct list' and /etc/pve/lxc/)" ;;
9993
# --- Proxmox Custom Codes ---
10094
200) echo "Custom: Failed to create lock file" ;;
10195
203) echo "Custom: Missing CTID variable" ;;
@@ -119,24 +113,6 @@ explain_exit_code() {
119113
225) echo "Custom: No template available for OS/Version (check 'pveam available')" ;;
120114
231) echo "Custom: LXC stack upgrade/retry failed (outdated pve-container - check https://github.com/community-scripts/ProxmoxVE/discussions/8126)" ;;
121115

122-
# --- Default ---
123-
*) echo "Unknown error" ;;
124-
208) echo "Custom: Invalid configuration (DNS/MAC/Network format error)" ;;
125-
209) echo "Custom: Container creation failed (check logs for pct create output)" ;;
126-
210) echo "Custom: Cluster not quorate" ;;
127-
211) echo "Custom: Timeout waiting for template lock (concurrent download in progress)" ;;
128-
214) echo "Custom: Not enough storage space" ;;
129-
215) echo "Custom: Container created but not listed (ghost state - check /etc/pve/lxc/)" ;;
130-
216) echo "Custom: RootFS entry missing in config (incomplete creation)" ;;
131-
217) echo "Custom: Storage does not support rootdir (check storage capabilities)" ;;
132-
218) echo "Custom: Template file corrupted or incomplete download (size <1MB or invalid archive)" ;;
133-
220) echo "Custom: Unable to resolve template path" ;;
134-
221) echo "Custom: Template file exists but not readable (check file permissions)" ;;
135-
222) echo "Custom: Template download failed after 3 attempts (network/storage issue)" ;;
136-
223) echo "Custom: Template not available after download (storage sync issue)" ;;
137-
225) echo "Custom: No template available for OS/Version (check 'pveam available')" ;;
138-
231) echo "Custom: LXC stack upgrade/retry failed (outdated pve-container - check https://github.com/community-scripts/ProxmoxVE/discussions/8126)" ;;
139-
140116
# --- Default ---
141117
*) echo "Unknown error" ;;
142118
esac

0 commit comments

Comments
 (0)