fix(hostname): refuse to rename a clustered node
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m20s
driver / test (3.12) (pull_request) Successful in 1m26s
driver / lowest (pull_request) Successful in 43s
driver / test (3.13) (pull_request) Successful in 1m21s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m20s
CI / driver (pull_request) Successful in 3m12s
driver / publish (pull_request) Skipped
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m20s
driver / test (3.12) (pull_request) Successful in 1m26s
driver / lowest (pull_request) Successful in 43s
driver / test (3.13) (pull_request) Successful in 1m21s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m20s
CI / driver (pull_request) Successful in 3m12s
driver / publish (pull_request) Skipped
The rename moves /etc/pve/nodes/<old> while the node still runs as <old>, which Proxmox does not support for a cluster member. set_hostname now checks for a corosync.conf first and raises before touching anything on a member, or when the check cannot be read; a single node renames as before. The check is the file, not `pvecm status`: pvecm decides membership by /etc/pve/corosync.conf itself, and its status also fails on a member whose corosync is down. /etc/corosync/corosync.conf covers a member whose /etc/pve is not mounted. Closes #21
This commit is contained in:
1 parent
9c7b64ba64
commit
8ef880b73b
3 files changed
+66
-8
No files matched your search
@@ -54,6 +54,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- `set_hostname()` renames only the node's own names in `/etc/hosts`: other
|
||||
hosts whose names start with the old one (`pve-backup`) and comments stay as
|
||||
they are, and the old FQDN becomes the new one instead of a mix of both (#21).
|
||||
- `set_hostname()` refuses a node that is part of a cluster (a
|
||||
`/etc/pve/corosync.conf` or `/etc/corosync/corosync.conf` exists) with a
|
||||
`CommandErrorException`, before changing anything: it moved
|
||||
`/etc/pve/nodes/<old>` while the cluster still knew the node as `<old>`. Also
|
||||
refused when the check cannot be read. A single node renames as before (#21).
|
||||
- `apply_updates()` reports a failed upgrade as `success: False`, with apt-get's
|
||||
exit status in `error`; it reported success whatever apt-get did (#20).
|
||||
- `get_users()` lists the node's root and regular login accounts (uid 1000 and
|
||||
|
||||
Reference in new issue
Block a user