mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 13:19:13 +00:00
uv_python module: improve latest state check mode to show version that will be installed
This commit is contained in:
parent
87ad81992d
commit
396fc6cbb2
1 changed files with 3 additions and 2 deletions
|
|
@ -101,10 +101,11 @@ class UV:
|
|||
def upgrade_python(self):
|
||||
rc, out, _ = self._find_python("--show-version")
|
||||
detected_version = out.split()[0]
|
||||
if rc == 0 and detected_version == self._get_latest_patch_release():
|
||||
latest_version = self._get_latest_patch_release()
|
||||
if rc == 0 and detected_version == latest_version:
|
||||
return False, out
|
||||
if self.module.check_mode:
|
||||
return True, ""
|
||||
return True, latest_version
|
||||
|
||||
cmd = [self.module.get_bin_path("uv", required=True), "python", "upgrade", self.python_version_str]
|
||||
rc, out, _ = self.module.run_command(cmd, check_rc=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue