This commit is contained in:
parent
8c633fd4b2
commit
5d3c265ce9
@ -34,15 +34,17 @@ var Sprintf = fmt.Sprintf
|
|||||||
func (command *Command) RunCmd(cmdCtxLogger zerolog.Logger, opts *ConfigOpts) ([]string, error) {
|
func (command *Command) RunCmd(cmdCtxLogger zerolog.Logger, opts *ConfigOpts) ([]string, error) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
outputArr []string
|
ArgsStr string // concatenating the arguments
|
||||||
ArgsStr string
|
|
||||||
cmdOutBuf bytes.Buffer
|
cmdOutBuf bytes.Buffer
|
||||||
cmdOutWriters io.Writer
|
cmdOutWriters io.Writer
|
||||||
|
errSSH error
|
||||||
|
|
||||||
envVars = environmentVars{
|
envVars = environmentVars{
|
||||||
file: command.Env,
|
file: command.Env,
|
||||||
env: command.Environment,
|
env: command.Environment,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outputArr []string // holds the output strings returned by processes
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get the command type
|
// Get the command type
|
||||||
@ -53,13 +55,13 @@ func (command *Command) RunCmd(cmdCtxLogger zerolog.Logger, opts *ConfigOpts) ([
|
|||||||
ArgsStr += fmt.Sprintf(" %s", v)
|
ArgsStr += fmt.Sprintf(" %s", v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print the user's password if it is updated
|
||||||
if command.Type == "user" {
|
if command.Type == "user" {
|
||||||
if command.UserOperation == "password" {
|
if command.UserOperation == "password" {
|
||||||
cmdCtxLogger.Info().Str("password", command.UserPassword).Msg("user password to be updated")
|
cmdCtxLogger.Info().Str("password", command.UserPassword).Msg("user password to be updated")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var errSSH error
|
|
||||||
// is host defined
|
// is host defined
|
||||||
if command.Host != nil {
|
if command.Host != nil {
|
||||||
outputArr, errSSH = command.RunCmdSSH(cmdCtxLogger, opts)
|
outputArr, errSSH = command.RunCmdSSH(cmdCtxLogger, opts)
|
||||||
|
Loading…
Reference in New Issue
Block a user