File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -67,17 +67,16 @@ def check_download_collection(name: str, dest: Path) -> None:
67
67
namespace , name = name .split ("." )
68
68
base_url = "https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections"
69
69
70
- url = f"{ base_url } /index/{ namespace } /{ name } /versions/?is_highest=true "
70
+ url = f"{ base_url } /index/{ namespace } /{ name } /"
71
71
try :
72
72
with urlopen (url ) as response : # noqa: S310
73
73
body = response .read ()
74
74
except HTTPError :
75
75
err = f"Failed to check collection version: { name } "
76
76
pytest .fail (err )
77
- with urlopen (url ) as response : # noqa: S310
78
- body = response .read ()
77
+
79
78
json_response = json .loads (body )
80
- version = json_response ["data" ][ 0 ]["version" ]
79
+ version = json_response ["highest_version" ]["version" ]
81
80
file_name = f"{ namespace } -{ name } -{ version } .tar.gz"
82
81
file_path = dest / file_name
83
82
if file_path .exists ():
You can’t perform that action at this time.
0 commit comments