mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shared/subprocess: Switch to go-yaml/v4
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
cda3ac59b7
commit
28e767d808
@ -7,7 +7,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
"go.yaml.in/yaml/v4"
|
||||
)
|
||||
|
||||
// NewProcess is a constructor for a process object. Represents a process with argument config.
|
||||
@ -58,7 +58,7 @@ func ImportProcess(path string) (*Process, error) {
|
||||
}
|
||||
|
||||
proc := Process{}
|
||||
err = yaml.Unmarshal(dat, &proc)
|
||||
err = yaml.Load(dat, &proc)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unable to parse YAML in PID file %q: %w", path, err)
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
"go.yaml.in/yaml/v4"
|
||||
|
||||
"github.com/lxc/incus/v6/shared/util"
|
||||
)
|
||||
@ -269,7 +269,7 @@ func (p *Process) Reload() error {
|
||||
|
||||
// Save will save the given process object to a YAML file. Can be imported at a later point.
|
||||
func (p *Process) Save(path string) error {
|
||||
dat, err := yaml.Marshal(p)
|
||||
dat, err := yaml.Dump(p, yaml.V2)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unable to serialize process struct to YAML: %w", err)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user