fix: moved lxc methods to seperate file

This commit is contained in:
2026-02-05 18:03:59 +01:00
parent fd0be6d493
commit 417c304f2d
3 changed files with 362 additions and 370 deletions

View File

@@ -37,20 +37,6 @@ func getCredentials() (username, token string, err error) {
return username, token, nil
}
func parseLXCProperties(data json.RawMessage) (*LXCProperties, error) {
var props LXCProperties
if err := json.Unmarshal(data, &props); err != nil {
return nil, fmt.Errorf("invalid file properties: %w", err)
}
if props.VMID == "" {
return nil, fmt.Errorf("vmid missing")
}
if props.Hostname == "" {
return nil, fmt.Errorf("name missing")
}
return &props, nil
}
func createAuthorizationString(username, token string) string {
return "PVEAPIToken=" + username + "=" + token
}