Bug 1828981
Summary: | [RFE] Add common argument parsing and configuration file for command line examples | ||
---|---|---|---|
Product: | [oVirt] ovirt-engine-sdk-python | Reporter: | Nir Soffer <nsoffer> |
Component: | Core | Assignee: | Nir Soffer <nsoffer> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Ilan Zuckerman <izuckerm> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 4.3.0 | CC: | bugs, eshenitz, juan.hernandez, mperina, sfishbai, tnisan |
Target Milestone: | ovirt-4.4.4 | Keywords: | FutureFeature, Reopened |
Target Release: | --- | Flags: | pm-rhel:
ovirt-4.4?
pm-rhel: planning_ack? pm-rhel: devel_ack+ pm-rhel: testing_ack+ |
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-12-21 12:35:39 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1848586 |
Description
Nir Soffer
2020-04-28 17:02:51 UTC
Examples in SDK should show a usage of SDK, but they are not mean to be a real command line tools. Closing due to capacity Martin, we already work on this here: https://gerrit.ovirt.org/c/109609/ https://gerrit.ovirt.org/c/109351/ Of course we plan to move this code to the new ovirt-img command, but we did start to work on it yet, and the code in the examples is used by QE and developer, and going to be used by backup vendors soon. This is implemented in the attached patches. Since the affected examples are only storage, and used by storage automated tests, I think this should be tested by storage QE. Shir, can you confirm? Here is an example usage with the new configuration: $ cat /home/nsoffer/.config/ovirt.conf [engine3] engine_url = https://engine3 username = admin@internal password = enginepassword cafile = /home/username/certs/engine3.pem $ ./upload_disk.py -c engine3 --sd-name nfs1 --disk-sparse fedora-32.raw [ 0.0 ] Checking image... [ 0.0 ] Image format: raw [ 0.0 ] Disk format: raw [ 0.0 ] Disk content type: data [ 0.0 ] Disk provisioned size: 6442450944 [ 0.0 ] Disk initial size: 6442450944 [ 0.0 ] Disk name: fedora-32.raw [ 0.0 ] Disk backup: False [ 0.0 ] Connecting... [ 0.0 ] Creating disk... [ 4.2 ] Disk ID: 157494d3-3f93-401a-88b7-792f0ea395c1 [ 4.2 ] Creating image transfer... [ 5.5 ] Transfer ID: 7647c957-7c1b-4f7d-998b-25a11399942d [ 5.5 ] Transfer host name: host4 [ 5.5 ] Uploading image... [ 100.00% ] 6.00 GiB, 2.82 seconds, 2.13 GiB/s [ 8.3 ] Finalizing image transfer... [ 11.3 ] Upload completed successfully (In reply to Nir Soffer from comment #2) > Martin, we already work on this here: > https://gerrit.ovirt.org/c/109609/ > https://gerrit.ovirt.org/c/109351/ > > Of course we plan to move this code to the new ovirt-img command, but > we did start to work on it yet, and the code in the examples is used > by QE and developer, and going to be used by backup vendors soon. As I told several times, examples in SDK should be used as a code pieces to create custom applications. Those examples should not be used as a command line tools in production. Just please cosinder also the effort needed to maintain this additional code you want to get into SDK release, because exactly command line parsing or reading configuration file should not be included in examples, because it has nothing to do with SDK. So I expect that all those code will be moved to ovirt-img-tool and SDK examples will really only contain example how to call a specific function ... (In reply to Martin Perina from comment #6) Ok, will move this bug to imageio. The posted patched will be part of ovirt-img. The patches already merged and tested with the following SDK version - python3-ovirt-engine-sdk4-4.4.3-1 Moving to VERIFIED This bugzilla is included in oVirt 4.4.4 release, published on December 21st 2020. Since the problem described in this bug report should be resolved in oVirt 4.4.4 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report. |