Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance remote command input output #1356

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

seokho-son
Copy link
Member

@seokho-son seokho-son commented Oct 10, 2023

Enhance remote command input output.

VM 원격 커맨드 기능의 입력 값 개선

  • 입력을 스트링 배열로 받을 수 있도록 처리
  • 입력된 배열은 순차 수행 (수행 중, 오류 발생시 후속 커맨드 실행하지 않도록 정리)
{
  "command": [
    "hostname","afweefwefw","client_ip=$(echo $SSH_CLIENT | awk '{print $1}'); echo SSH client IP is: $client_ip"
  ],
  "userName": "cb-user"
}

VM 원격 커맨드 기능의 출력 값 개선

  • 기존 단일 result 스트링에서, stdout / stderr 을 명시적으로 구분
  • 실행 순서를 명시하여, 커맨드별 결과를 쉽게 이해할 수 있도록 개선
{
  "results": [
    {
      "mcisId": "mcis01",
      "vmId": "g1-1",
      "vmIp": "13.124.161.45",
      "stdout": {
        "0": "ip-192-168-20-83\n",
        "1": "",
        "2": "SSH client IP is: 192.168.20.83\n"
      },
      "stderr": {
        "0": "",
        "1": "bash: afweefwefw: command not found\n",
        "2": ""
      },
      "err": null
    }
  ]
}

@seokho-son
Copy link
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Oct 10, 2023
@seokho-son seokho-son merged commit cfb818c into cloud-barista:main Oct 10, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This PR is approved and will be merged soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant