Files
Prophet731 9d57ee6150 fix(changepackage): treat HTTP 200 as success and repair resource modify calls
VirtFusion v7's PUT /servers/{id}/package/{pkg} returns HTTP 200 (with an
{info:[...]} body), not 204. changePackage() only accepted 204, so every
successful package change fell through to the default case and reported
"Update package request failed. VirtFusion API returned HTTP 200" — the
exact error seen in production. The early return also skipped the
memory/CPU/traffic modify loop entirely.

- Accept 200 (and keep 204) as success; log the info array so operator can
  see skipped changes (e.g. "primary disk not updated... lower than current").
- modifyResource(): send cpuCores as the spec-required "cores" body field
  (wrong field name omitted the required property → CPU changes rejected).
- modifyResource(): accept 201 alongside 200/204 — VF v7 returns 201 Created
  on modify, mirroring the existing rename-endpoint fix.
- Surface modifyResource() failures in the package-change loop instead of
  swallowing them.

Disk-downgrade safety is unchanged and confirmed: no disk flag is sent, the
modify allowlist excludes storage, no disk-modify endpoint exists, and VF
itself refuses to shrink the primary disk.

Verified against the VirtFusion v7 OpenAPI spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 11:59:17 -05:00
..