-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] Update ovftool, virt-v2v version check cmds to run with quotes #11566
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
base: 4.20
Are you sure you want to change the base?
Conversation
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11566 +/- ##
=========================================
Coverage 16.17% 16.17%
- Complexity 13284 13286 +2
=========================================
Files 5656 5656
Lines 498015 498015
Branches 60406 60406
=========================================
+ Hits 80538 80541 +3
+ Misses 408514 408513 -1
+ Partials 8963 8961 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds double quotes around shell command strings used for version checking of ovftool and virt-v2v tools. This enhancement ensures proper command execution when these commands contain special characters or spaces that could be misinterpreted by the shell.
- Wraps existing version check commands in double quotes for safe shell execution
- Updates commands for ovftool, virt-v2v, and package checking utilities
- Maintains backward compatibility while improving command reliability
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
public static final String INSTANCE_CONVERSION_SUPPORTED_CHECK_CMD = "\"virt-v2v --version\""; | ||
// virt-v2v --version => sample output: virt-v2v 1.42.0rhel=8,release=22.module+el8.10.0+1590+a67ab969 | ||
public static final String OVF_EXPORT_SUPPORTED_CHECK_CMD = "ovftool --version"; | ||
public static final String OVF_EXPORT_SUPPORTED_CHECK_CMD = "\"ovftool --version\""; | ||
// ovftool --version => sample output: VMware ovftool 4.6.0 (build-21452615) | ||
public static final String OVF_EXPORT_TOOl_GET_VERSION_CMD = "ovftool --version | awk '{print $3}'"; | ||
public static final String OVF_EXPORT_TOOl_GET_VERSION_CMD = "\"ovftool --version | awk '{print $3}'\""; | ||
|
||
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "rpm -qa | grep -i virtio-win"; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "dpkg -l virtio-win"; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "dpkg -l nbdkit"; | ||
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"rpm -qa | grep -i virtio-win\""; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"dpkg -l virtio-win\""; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "\"dpkg -l nbdkit\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding quotes around entire commands may cause issues depending on how these constants are used. If these strings are passed to ProcessBuilder or similar APIs that handle arguments separately, the quotes will be interpreted literally rather than as shell quoting. Consider reviewing how these constants are consumed to ensure the quoting approach is appropriate for the execution method.
Copilot uses AI. Check for mistakes.
public static final String INSTANCE_CONVERSION_SUPPORTED_CHECK_CMD = "\"virt-v2v --version\""; | ||
// virt-v2v --version => sample output: virt-v2v 1.42.0rhel=8,release=22.module+el8.10.0+1590+a67ab969 | ||
public static final String OVF_EXPORT_SUPPORTED_CHECK_CMD = "ovftool --version"; | ||
public static final String OVF_EXPORT_SUPPORTED_CHECK_CMD = "\"ovftool --version\""; | ||
// ovftool --version => sample output: VMware ovftool 4.6.0 (build-21452615) | ||
public static final String OVF_EXPORT_TOOl_GET_VERSION_CMD = "ovftool --version | awk '{print $3}'"; | ||
public static final String OVF_EXPORT_TOOl_GET_VERSION_CMD = "\"ovftool --version | awk '{print $3}'\""; | ||
|
||
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "rpm -qa | grep -i virtio-win"; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "dpkg -l virtio-win"; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "dpkg -l nbdkit"; | ||
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"rpm -qa | grep -i virtio-win\""; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"dpkg -l virtio-win\""; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "\"dpkg -l nbdkit\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding quotes around entire commands may cause issues depending on how these constants are used. If these strings are passed to ProcessBuilder or similar APIs that handle arguments separately, the quotes will be interpreted literally rather than as shell quoting. Consider reviewing how these constants are consumed to ensure the quoting approach is appropriate for the execution method.
Copilot uses AI. Check for mistakes.
public static final String INSTANCE_CONVERSION_SUPPORTED_CHECK_CMD = "\"virt-v2v --version\""; | ||
// virt-v2v --version => sample output: virt-v2v 1.42.0rhel=8,release=22.module+el8.10.0+1590+a67ab969 | ||
public static final String OVF_EXPORT_SUPPORTED_CHECK_CMD = "ovftool --version"; | ||
public static final String OVF_EXPORT_SUPPORTED_CHECK_CMD = "\"ovftool --version\""; | ||
// ovftool --version => sample output: VMware ovftool 4.6.0 (build-21452615) | ||
public static final String OVF_EXPORT_TOOl_GET_VERSION_CMD = "ovftool --version | awk '{print $3}'"; | ||
public static final String OVF_EXPORT_TOOl_GET_VERSION_CMD = "\"ovftool --version | awk '{print $3}'\""; | ||
|
||
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "rpm -qa | grep -i virtio-win"; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "dpkg -l virtio-win"; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "dpkg -l nbdkit"; | ||
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"rpm -qa | grep -i virtio-win\""; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"dpkg -l virtio-win\""; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "\"dpkg -l nbdkit\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding quotes around entire commands may cause issues depending on how these constants are used. If these strings are passed to ProcessBuilder or similar APIs that handle arguments separately, the quotes will be interpreted literally rather than as shell quoting. Consider reviewing how these constants are consumed to ensure the quoting approach is appropriate for the execution method.
Copilot uses AI. Check for mistakes.
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"rpm -qa | grep -i virtio-win\""; | ||
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"dpkg -l virtio-win\""; | ||
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "\"dpkg -l nbdkit\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding quotes around entire commands may cause issues depending on how these constants are used. If these strings are passed to ProcessBuilder or similar APIs that handle arguments separately, the quotes will be interpreted literally rather than as shell quoting. Consider reviewing how these constants are consumed to ensure the quoting approach is appropriate for the execution method.
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"rpm -qa | grep -i virtio-win\""; | |
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "\"dpkg -l virtio-win\""; | |
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "\"dpkg -l nbdkit\""; | |
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "dpkg -l nbdkit"; |
Copilot uses AI. Check for mistakes.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14830 |
Description
This PR updates ovftool, virt-v2v version check cmds to run with quotes.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?