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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user