Skip to content

Commit

Permalink
fix: drop distutils (#106)
Browse files Browse the repository at this point in the history
* fix: drop `distutils`

* fix: typo in README
  • Loading branch information
mateimicu authored Sep 13, 2024
1 parent cf467ec commit 93d86f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/executable-dependency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ page](https://github.com/gruntwork-io/terraform-aws-utilities/releases):

```hcl
module "path" {
source = "git::[email protected]:gruntwork-io/terraform-aws-utilities.git//modules/join-path?ref=<VERSION>"
source = "git::[email protected]:gruntwork-io/terraform-aws-utilities.git//modules/executable-dependency?ref=<VERSION>"
executable = "kubergrunt"
download_url = "https://github.com/gruntwork-io/kubergrunt/releases/download/v0.5.13/kubergrunt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


import sys
import distutils.spawn
import json
import tempfile
import os
Expand All @@ -15,6 +14,7 @@
import logging
import errno
import argparse
import shutil

from urllib.request import urlretrieve

Expand Down Expand Up @@ -44,7 +44,7 @@ def main():
executable_install_dir_path = os.path.join(args.install_dir, args.executable)

# First, check if the executable is on the system PATH
executable_path = distutils.spawn.find_executable(args.executable)
executable_path = shutil.which(args.executable)

# If it's not on the system PATH, check if it's in the install dir passed in by the user
if not executable_path and os.path.isfile(executable_install_dir_path):
Expand Down
4 changes: 2 additions & 2 deletions modules/require-executable/require_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import json
import logging
import sys
from distutils import spawn
import shutil


_ERROR_MESSAGE_EXECUTABLE_MARKER = "__EXECUTABLE_NAME__"
Expand Down Expand Up @@ -58,7 +58,7 @@ def main():
if not executable.strip():
continue

maybe_executable = spawn.find_executable(executable)
maybe_executable = shutil.which(executable)
if not maybe_executable:
not_found.append(executable)
else:
Expand Down

0 comments on commit 93d86f8

Please sign in to comment.