pylxd icon indicating copy to clipboard operation
pylxd copied to clipboard

image(all): added ability to specify recursion when getting all images

Open MrDaGree opened this issue 1 year ago • 4 comments

Similarly to #551, being able to specify recursion when getting images would be useful to speedier requests when creating scripts that need to pull information like aliases for images

>>> for image in client.images.all(recursion=1):
...   print(image.aliases)
... 
[{'name': 'example/image/01', 'description': ''}]
[{'name': 'example/image/02', 'description': ''}]
[{'name': 'example/image/03', 'description': ''}]
[{'name': 'example/image/04', 'description': ''}]

MrDaGree avatar Aug 11 '23 14:08 MrDaGree

Codecov Report

Merging #558 (5a6c59f) into main (fb501c0) will decrease coverage by 0.19%. The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main     #558      +/-   ##
==========================================
- Coverage   97.25%   97.07%   -0.19%     
==========================================
  Files          56       56              
  Lines        4261     4272      +11     
==========================================
+ Hits         4144     4147       +3     
- Misses        117      125       +8     
Files Changed Coverage Δ
pylxd/models/image.py 93.54% <50.00%> (-6.46%) :arrow_down:

codecov[bot] avatar Aug 11 '23 14:08 codecov[bot]

Hi @MrDaGree, there are a couple of failing github actions for your PR. These were not caught in #551 because the target branch of the job had not been changed from master to main when we renamed the org from lxc to canonical (see #552).

There are some instructions on how to get these actions to pass in the documentation here https://pylxd.readthedocs.io/en/latest/contributing.html#requirements-to-merge-a-pull-request-pr. If you have any problems let me know. Thanks!

markylaing avatar Aug 21 '23 08:08 markylaing

Just to make sure I fully understand, this is related to the -0.19% decrease in test coverage and needing to update the tests for both this PR and the last to ensure the % is covered?

MrDaGree avatar Aug 21 '23 14:08 MrDaGree

Just to make sure I fully understand, this is related to the -0.19% decrease in test coverage and needing to update the tests for both this PR and the last to ensure the % is covered?

I believe so yes. Here is the commit which which fixed it for instances after we fixed the workflow branch https://github.com/canonical/pylxd/pull/554/commits/2a6c7feaa54ac6a5c712911bc826dbe48b7c77ec

markylaing avatar Aug 21 '23 14:08 markylaing