diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-21 16:12:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-21 16:12:25 +0200 |
commit | 12655484e39eadbc0fa0607542aa4a49a21013a1 (patch) | |
tree | 9690fd321a567f302c0fc2d46854b00316af3957 /pkg/machine/qemu/machine.go | |
parent | a4399ef813840b48fc027edc3d0bdedf8a038f23 (diff) | |
parent | d968f3fe09a4c7d74464cfe2eaa9e4febbe61ba5 (diff) | |
download | podman-12655484e39eadbc0fa0607542aa4a49a21013a1.tar.gz podman-12655484e39eadbc0fa0607542aa4a49a21013a1.tar.bz2 podman-12655484e39eadbc0fa0607542aa4a49a21013a1.zip |
Merge pull request #15871 from cevich/replace_ioutil
Replace deprecated ioutil
Diffstat (limited to 'pkg/machine/qemu/machine.go')
-rw-r--r-- | pkg/machine/qemu/machine.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index 738cd74be..fab25aa35 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -12,7 +12,6 @@ import ( "errors" "fmt" "io/fs" - "io/ioutil" "net" "net/http" "net/url" @@ -391,11 +390,11 @@ func (v *MachineVM) Init(opts machine.InitOptions) (bool, error) { // If the user provides an ignition file, we need to // copy it into the conf dir if len(opts.IgnitionPath) > 0 { - inputIgnition, err := ioutil.ReadFile(opts.IgnitionPath) + inputIgnition, err := os.ReadFile(opts.IgnitionPath) if err != nil { return false, err } - return false, ioutil.WriteFile(v.getIgnitionFile(), inputIgnition, 0644) + return false, os.WriteFile(v.getIgnitionFile(), inputIgnition, 0644) } // Write the ignition file ign := machine.DynamicIgnition{ @@ -1109,7 +1108,7 @@ func getVMInfos() ([]*machine.ListResponse, error) { vm := new(MachineVM) if strings.HasSuffix(d.Name(), ".json") { fullPath := filepath.Join(vmConfigDir, d.Name()) - b, err := ioutil.ReadFile(fullPath) + b, err := os.ReadFile(fullPath) if err != nil { return err } @@ -1539,7 +1538,7 @@ func (v *MachineVM) writeConfig() error { if err != nil { return err } - if err := ioutil.WriteFile(v.ConfigPath.GetPath(), b, 0644); err != nil { + if err := os.WriteFile(v.ConfigPath.GetPath(), b, 0644); err != nil { return err } return nil |