Missing detailed printing information when exec_sudo fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
diskimage-builder |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This patch tries to add more detailed info by appending error output to exec_sudo print.
In current implementation, only a simple static note `Exception: exec_sudo failed` is printed:
```
INFO diskimage_
ERROR diskimage_
// ... ...
diskimage_
```
but the root reason is missing. We can’t get more error info to make sure what the real root reason even a simple problem like `command not found`, we have to reproduce locally and manually.
After this patch, the error message like:
```
INFO diskimage_
ERROR diskimage_
// ... ...
diskimage_
```
It's easy to find the real problem and solve it.
summary: |
- Append detailed printing information when exec_sudo fails + Missing detailed printing information when exec_sudo fails |
Reviewed: https:/ /review. opendev. org/c/openstack /diskimage- builder/ +/886908 /opendev. org/openstack/ diskimage- builder/ commit/ 864ae115091964a 4648667bc72e2c5 d8f41effae
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 864ae115091964a 4648667bc72e2c5 d8f41effae
Author: wjunlu <email address hidden>
Date: Sun Jun 25 15:20:37 2023 +0800
Append detailed printing information when exec_sudo fails
This patch tries to add more detailed info by appending
error output to exec_sudo print.
In current implementation, only a simple static note `Exception: builder. block_device. utils [-] Calling [sudo sgdisk dib_image. jZaDPxtX/ image0. raw -n 1:0:+550M -t 1:EF00 -c 1:ESP builder. block_device. blockdevice [-] Create failed; builder. block_device. exception. BlockDeviceSetu pException:
exec_sudo failed` is printed:
```
INFO diskimage_
/tmp/
-n 2:0:+8M -t 2:EF02 -c 2:BSP -n 3:0:+2077M -t 3:8300 -c 3:root]
ERROR diskimage_
rollback initiated
// ... ...
diskimage_
exec_sudo failed
```
but the root reason is missing. We can’t get more error info to
make sure what the real root reason even a simple problem like
`command not found`, we have to reproduce locally and manually.
After this patch, the error message like: builder. block_device. utils [-] Calling [sudo sgdisk dib_image. jZaDPxtX/ image0. raw -n 1:0:+550M -t 1:EF00 -c 1:ESP builder. block_device. blockdevice [-] Create failed; builder. block_device. exception. BlockDeviceSetu pException:
```
INFO diskimage_
/tmp/
-n 2:0:+8M -t 2:EF02 -c 2:BSP -n 3:0:+2077M -t 3:8300 -c 3:root]
ERROR diskimage_
rollback initiated
// ... ...
diskimage_
exec_sudo failed: sudo: sgdisk: command not found
```
We can easily find the real problem and solve it.
Closes-Bug: #2024980
Change-Id: I9efcd9cb6621e6 403df6de14f122b 1cf371bd800