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 syntax error #84

Merged
merged 8 commits into from
Feb 26, 2024
Merged

Fix syntax error #84

merged 8 commits into from
Feb 26, 2024

Conversation

jsf9k
Copy link
Member

@jsf9k jsf9k commented Feb 23, 2024

🗣 Description

This pull request corrects two syntax errors that arose because of the changes in #82.

💭 Motivation and context

The Docker image does not execute correctly without these fixes:

$ docker compose logs -t save
orchestrator-save-1  | 2024-02-23T00:00:02.624443232Z Waiting for scanner
orchestrator-save-1  | 2024-02-23T13:29:16.945750283Z Scanner finished
orchestrator-save-1  | 2024-02-23T13:29:16.947284535Z 1
orchestrator-save-1  | 2024-02-23T13:29:16.947448973Z Processing results...
orchestrator-save-1  | 2024-02-23T13:29:18.638736285Z Deleted 0 old SLD records from "scan" database on database1.cyhy.
orchestrator-save-1  | 2024-02-23T13:30:42.510420676Z Importing to "scan" database on database1.cyhy...
orchestrator-save-1  | 2024-02-23T13:30:42.510451432Z Successfully imported 100562 documents to "scan" database on database1.cyhy
orchestrator-save-1  | 2024-02-23T13:32:28.080645506Z Importing to "scan" database on database1.cyhy...
orchestrator-save-1  | 2024-02-23T13:32:28.080692424Z Successfully imported 100562 documents to "scan" database on database1.cyhy
orchestrator-save-1  | 2024-02-23T13:32:41.011308323Z Importing to "scan" database on database1.cyhy...
orchestrator-save-1  | 2024-02-23T13:32:41.011388144Z Traceback (most recent call last):
orchestrator-save-1  | 2024-02-23T13:32:41.011419299Z   File "/home/cisa/./sslyze_csv2mongo.py", line 235, in <module>
orchestrator-save-1  | 2024-02-23T13:32:41.011521486Z     main()
orchestrator-save-1  | 2024-02-23T13:32:41.011582088Z   File "/home/cisa/./sslyze_csv2mongo.py", line 43, in main
orchestrator-save-1  | 2024-02-23T13:32:41.011675781Z     store_data(opened_files[0], opened_files[1], DB_CONFIG_FILE)
orchestrator-save-1  | 2024-02-23T13:32:41.011737477Z   File "/home/cisa/./sslyze_csv2mongo.py", line 183, in store_data
orchestrator-save-1  | 2024-02-23T13:32:41.011834859Z     row[date_item] = datetime.datetime.strptime(
orchestrator-save-1  | 2024-02-23T13:32:41.011880801Z                      ^^^^^^^^^^^^^^^^^
orchestrator-save-1  | 2024-02-23T13:32:41.011964471Z AttributeError: type object 'datetime.datetime' has no attribute 'datetime'
orchestrator-save-1  | 2024-02-23T13:32:41.464076548Z OK

🧪 Testing

The Docker image does execute correctly with these fixes:

$ docker compose logs -t -f save
orchestrator-save-1  | 2024-02-23T20:48:15.084755319Z Waiting for scanner
orchestrator-save-1  | 2024-02-23T20:48:30.094986931Z Scanner finished
orchestrator-save-1  | 2024-02-23T20:48:30.096346410Z 1
orchestrator-save-1  | 2024-02-23T20:48:30.096510547Z Processing results...
orchestrator-save-1  | 2024-02-23T20:48:31.596582293Z Deleted 0 old SLD records from "scan" database on database1.cyhy.
orchestrator-save-1  | 2024-02-23T20:49:48.769361361Z Importing to "scan" database on database1.cyhy...
orchestrator-save-1  | 2024-02-23T20:49:48.769404538Z Successfully imported 100562 documents to "scan" database on database1.cyhy
orchestrator-save-1  | 2024-02-23T20:51:29.271934653Z Importing to "scan" database on database1.cyhy...
orchestrator-save-1  | 2024-02-23T20:51:29.271984757Z Successfully imported 100562 documents to "scan" database on database1.cyhy
orchestrator-save-1  | 2024-02-23T20:51:53.351031250Z Importing to "scan" database on database1.cyhy...
orchestrator-save-1  | 2024-02-23T20:51:53.351067244Z Successfully imported 25767 documents to "scan" database on database1.cyhy
orchestrator-save-1  | 2024-02-23T20:51:53.534529132Z OK
orchestrator-save-1 exited with code 0

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Finalize version.

✅ Post-merge checklist

  • Create a release.

@jsf9k jsf9k added bug This issue or pull request addresses broken functionality version bump This issue or pull request increments the version number python Pull requests that update Python code labels Feb 23, 2024
@jsf9k jsf9k self-assigned this Feb 23, 2024
@jsf9k jsf9k requested a review from a team February 23, 2024 20:58
@jsf9k jsf9k marked this pull request as ready for review February 23, 2024 21:03
@jsf9k jsf9k enabled auto-merge February 23, 2024 21:03
@jsf9k jsf9k disabled auto-merge February 23, 2024 21:12
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

LGTM ✔. One change request and one thought for your consideration.

src/sslyze_csv2mongo.py Outdated Show resolved Hide resolved
src/sslyze_csv2mongo.py Outdated Show resolved Hide resolved
@jsf9k jsf9k requested review from dav3r and mcdonnnj February 25, 2024 18:48
@jsf9k
Copy link
Member Author

jsf9k commented Feb 26, 2024

A wild @felddy appears!

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

👍 👍

Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

LGTM ✔

@jsf9k jsf9k enabled auto-merge February 26, 2024 20:21
@jsf9k jsf9k merged commit 1a2b6ad into develop Feb 26, 2024
17 checks passed
@jsf9k jsf9k deleted the bugfix/fix-syntax-error branch February 26, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality python Pull requests that update Python code version bump This issue or pull request increments the version number
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants