1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

global: Update usage of shared/subprocess

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
Stéphane Graber
2023-09-07 19:08:04 -04:00
parent 09c067f8f6
commit 9f0dae0eaf
58 changed files with 380 additions and 341 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/lxc/incus/incusd/util"
"github.com/lxc/incus/shared"
"github.com/lxc/incus/shared/api"
"github.com/lxc/incus/shared/subprocess"
)
func serverIsConfigured(client incus.InstanceServer) (bool, error) {
@@ -71,7 +72,7 @@ func serverInitialConfiguration(client incus.InstanceServer) error {
pool.Driver = "zfs"
// Check if zsys.
poolName, _ := shared.RunCommand("zpool", "get", "-H", "-o", "value", "name", "rpool")
poolName, _ := subprocess.RunCommand("zpool", "get", "-H", "-o", "value", "name", "rpool")
if strings.TrimSpace(poolName) == "rpool" {
pool.Config["source"] = "rpool/incus"
}
@@ -143,7 +144,7 @@ func serverSetupUser(uid uint32) error {
userPath := filepath.Join("users", fmt.Sprintf("%d", uid))
// User account.
out, err := shared.RunCommand("getent", "passwd", fmt.Sprintf("%d", uid))
out, err := subprocess.RunCommand("getent", "passwd", fmt.Sprintf("%d", uid))
if err != nil {
return fmt.Errorf("Failed to retrieve user information: %w", err)
}