Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat' #121

Open
anskrish opened this issue May 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@anskrish
Copy link

👟 Reproduction steps

airiam find_unused

:~# airiam find_unused

     ____      __           _____      ____     __        __
    / __ \    |__|  _  ____|_   _|    / __ \   |   \    /   |
   / /  \ \    __  | |/ ___| | |     / /  \ \  | |\ \  / /| |
  / /____\ \  |  | |   /     | |    / /____\ \ | | \ \/ / | |
 /  ______  \_|  |_|  |     _| |_  /  ______  \  |  \  /  | |
/_/        \_\_____|__|    |_____|/_/        \_\_|   \/   |_|
v0.1.64 

AirIAM - Least privilege AWS IAM Terraformer

To continuously scan configurations, try the Bridgecrew free community plan.
https://www.bridgecrew.io

INFO:botocore.credentials:Found credentials in environment variables.
Reusing local data
Traceback (most recent call last):
  File "/usr/local/bin/airiam", line 5, in <module>
    run()
  File "/usr/local/lib/python3.6/dist-packages/airiam/main.py", line 29, in run
    runtime_results = find_unused(logger, args.profile, args.no_cache, args.last_used_threshold, args.command)
  File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 55, in find_unused
    unused_users, used_users = find_unused_users(account_users, credential_report, unused_threshold)
  File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 83, in find_unused_users
    days_from_today(credentials.get('access_key_1_last_used_date', 'N/A')),
  File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 249, in days_from_today
    date = dt.datetime.fromisoformat(str_date_from_today)
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'

👍 Expected behavior

it should generate a report

👎 Actual Behavior

:~# airiam find_unused

     ____      __           _____      ____     __        __
    / __ \    |__|  _  ____|_   _|    / __ \   |   \    /   |
   / /  \ \    __  | |/ ___| | |     / /  \ \  | |\ \  / /| |
  / /____\ \  |  | |   /     | |    / /____\ \ | | \ \/ / | |
 /  ______  \_|  |_|  |     _| |_  /  ______  \  |  \  /  | |
/_/        \_\_____|__|    |_____|/_/        \_\_|   \/   |_|
v0.1.64 

AirIAM - Least privilege AWS IAM Terraformer

To continuously scan configurations, try the Bridgecrew free community plan.
https://www.bridgecrew.io

INFO:botocore.credentials:Found credentials in environment variables.
Reusing local data
Traceback (most recent call last):
  File "/usr/local/bin/airiam", line 5, in <module>
    run()
  File "/usr/local/lib/python3.6/dist-packages/airiam/main.py", line 29, in run
    runtime_results = find_unused(logger, args.profile, args.no_cache, args.last_used_threshold, args.command)
  File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 55, in find_unused
    unused_users, used_users = find_unused_users(account_users, credential_report, unused_threshold)
  File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 83, in find_unused_users
    days_from_today(credentials.get('access_key_1_last_used_date', 'N/A')),
  File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 249, in days_from_today
    date = dt.datetime.fromisoformat(str_date_from_today)
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'

💻 Operating system

Linux

🧱 Your Environment

No response

Python Version

root@xx:~# python --version
Python 2.7.17
root@xx:~# python3 --version
Python 3.6.9
root@ip-xx:~#```

### checkov-version

not installed

### Share output with the environment variable LOG_LEVEL set to DEBUG

Reusing local data
Traceback (most recent call last):
File "/usr/local/bin/airiam", line 5, in
run()
File "/usr/local/lib/python3.6/dist-packages/airiam/main.py", line 29, in run
runtime_results = find_unused(logger, args.profile, args.no_cache, args.last_used_threshold, args.command)
File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 55, in find_unused
unused_users, used_users = find_unused_users(account_users, credential_report, unused_threshold)
File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 83, in find_unused_users
days_from_today(credentials.get('access_key_1_last_used_date', 'N/A')),
File "/usr/local/lib/python3.6/dist-packages/airiam/find_unused/find_unused.py", line 249, in days_from_today
date = dt.datetime.fromisoformat(str_date_from_today)
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'


### 👀 Have you spent some time to check if this issue has been raised before?

- [X] I checked and didn't find similar issue
@anskrish anskrish added the bug Something isn't working label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant