Skip to content

Commit

Permalink
Merge pull request #53 from aws-samples/fix/issue-52
Browse files Browse the repository at this point in the history
Fix/issue 52
valter-silva-au authored Aug 28, 2023
2 parents 2407e77 + fb48b5b commit c270f82
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ repos:
# - id: flake8
# args: ['--ignore=E501']
- repo: https://github.com/jendrikseipp/vulture
rev: 'v2.7' # or any later Vulture version
rev: 'v2.9.1' # or any later Vulture version
hooks:
- id: vulture
args: ['scan.py', ]
9 changes: 6 additions & 3 deletions scan.py
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@
from datetime import datetime
import requests

# Define the timestamp as a string, which will be the same throughout the execution of the script.
timestamp = datetime.now().isoformat(timespec="minutes")
# accomodate windows and unix path
timestamp = datetime.now().isoformat(timespec="minutes").replace(":", "-")


def get_json_from_url(url):
@@ -314,7 +314,10 @@ def main(
results.extend(region_results)
for service_result in region_results:
directory = os.path.join(output_dir, timestamp, region)
os.makedirs(directory, exist_ok=True)
try:
os.makedirs(directory, exist_ok=True)
except NotADirectoryError:
log.error("Invalid directory name: %s", directory)
with open(
os.path.join(directory, f"{service_result['service']}.json"),
"w",

0 comments on commit c270f82

Please sign in to comment.