Copilot commented on code in PR #11887:
URL: https://github.com/apache/cloudstack/pull/11887#discussion_r2450843039
##########
.github/workflows/ci.yml:
##########
@@ -234,6 +234,24 @@ jobs:
sudo apt-get update
sudo apt-get install -y git uuid-runtime genisoimage netcat-openbsd
ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0
libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl
python3-dev python3-setuptools
+ - name: Setup IPMI Tool for CloudStack
+ run: |
+ # Create cloudstack-common directory if it doesn't exist
+ sudo mkdir -p /usr/share/cloudstack-common
+
+ # Copy ipmitool to cloudstack-common directory if it doesn't exist
+ if [ ! -f /usr/share/cloudstack-common/ipmitool ]; then
+ sudo cp /usr/bin/ipmitool /usr/share/cloudstack-common/ipmitool
+ sudo chmod 755 /usr/share/cloudstack-common/ipmitool
+ fi
+
+ # Create ipmitool-C3 wrapper script
+ sudo tee /usr/bin/ipmitool > /dev/null << 'EOF'
Review Comment:
[nitpick] Overwriting the system `ipmitool` binary in `/usr/bin/ipmitool`
could cause confusion or conflicts if other processes expect the original
binary. Consider using a different path like `/usr/local/bin/ipmitool-wrapper`
and updating the PATH, or documenting why this approach is necessary for the CI
environment.
##########
.github/workflows/ci.yml:
##########
@@ -234,6 +234,24 @@ jobs:
sudo apt-get update
sudo apt-get install -y git uuid-runtime genisoimage netcat-openbsd
ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0
libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl
python3-dev python3-setuptools
+ - name: Setup IPMI Tool for CloudStack
+ run: |
+ # Create cloudstack-common directory if it doesn't exist
+ sudo mkdir -p /usr/share/cloudstack-common
+
+ # Copy ipmitool to cloudstack-common directory if it doesn't exist
+ if [ ! -f /usr/share/cloudstack-common/ipmitool ]; then
+ sudo cp /usr/bin/ipmitool /usr/share/cloudstack-common/ipmitool
+ sudo chmod 755 /usr/share/cloudstack-common/ipmitool
+ fi
+
+ # Create ipmitool-C3 wrapper script
+ sudo tee /usr/bin/ipmitool > /dev/null << 'EOF'
+ #!/bin/bash
+ /usr/share/cloudstack-common/ipmitool -C3 $@
Review Comment:
The use of `$@` without quotes can cause issues with arguments containing
spaces or special characters. Replace `$@` with `\"$@\"` to properly preserve
argument boundaries and handle special characters.
```suggestion
/usr/share/cloudstack-common/ipmitool -C3 "$@"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]