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

Fix imports and a few logic errors #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dushankw
Copy link

  1. Imports are broken in Python 3 due to changing of module namespaces:
[$] python -V
Python 3.7.6

[$] python dns-domain-expiration-checker.py
Traceback (most recent call last):
  File "dns-domain-expiration-checker.py", line 24, in <module>
    from email.MIMEMultipart import MIMEMultipart
ModuleNotFoundError: No module named 'email.MIMEMultipart' 

I have added a condition such that the correct names are used for Python 3 while still working in Python 2.

  1. There was a type mismatch in the expiry comparison logic, I have fixed it by casting the correct type (str vs binary) on the variable.

  2. The output logic for the application only returns a value for days left to expiry if it is < threshold defined by user, I believe this is a mistake and a number should always be output, as currently it will return 0 when a domain is > threshold which implies a valid domain is expired...

@dushankw
Copy link
Author

Also add "Expire Date:" to EXPIRE_STRINGS, this is the value used by nic.it

@dushankw dushankw requested a review from Matty9191 February 16, 2020 06:43
Copy link

@biji biji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point IMHO, but please rebase to new branch with only fix imports changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants