goconserver icon indicating copy to clipboard operation
goconserver copied to clipboard

Need better command line parsing for the `cmd` driver of `congo`

Open neo954 opened this issue 7 years ago • 0 comments

This bug is against goconserver Version: 0.1, BuildTime: 2017-11-07T23:00:03-0500 Commit: 906cd810f009dd1b0b22a75ea0c4efc1cbb2e840 running on a ppc64le Red Hat 7.4 Linux environment.

The recreation steps

# congo create c910f03c17 driver=cmd ondemand=false --params cmd="ipmitool -I lanplus -H 50.3.17.1 -U '' -P PASSW0RD sol activate"
Created
# congo console c910f03c17
goconserver(2017-11-08 03:41:59): Hello 127.0.0.1:57410, welcome to the session of c910f03c18
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:42:09): Hello 127.0.0.1:57412, welcome to the session of c910f03c18
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:42:19): Hello 127.0.0.1:57414, welcome to the session of c910f03c17
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:42:29): Hello 127.0.0.1:57416, welcome to the session of c910f03c17
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:42:39): Hello 127.0.0.1:57418, welcome to the session of c910f03c17
Error: Unable to establish IPMI v2 / RMCP+ session
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:42:49): Hello 127.0.0.1:57420, welcome to the session of c910f03c17
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:42:59): Hello 127.0.0.1:57422, welcome to the session of c910f03c17
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:43:09): Hello 127.0.0.1:57424, welcome to the session of c910f03c17
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
goconserver(2017-11-08 03:43:19): Hello 127.0.0.1:57426, welcome to the session of c910f03c17
Could not receive message, error: EOF
Could not receive message, error: EOF
Session is teminated unexpectedly, retrying....
The connection is disconnected

What actually happened

The intention is to run the command, ipmitool -I lanplus -H 50.3.17.1 -U '' -P PASSW0RD sol activate, under the cmd driver of congo. Please notice, in the ipmitool command, there is an empty string as one of its command line argument. For pass such an empty string in bash, it can be done with single quotes. But for congo, there is no way to do this.

Currently, there is no way to pass a space character inside the command line argument. Space character is always used as the separation character.

What is expected

  • Escape character support for command line parse, or single quotes, double quotes support.
  • Maybe, use bash -c 'exec run a command' to run the command, in this way, bash will do the command line parsing works.

neo954 avatar Nov 08 '17 08:11 neo954