Skip to content

Commit 2896383

Browse files
authored
Merge pull request #82 from cisagov/improvement/get-rid-of-deprecation-warnings
Get rid of deprecation warnings
2 parents 40f4de9 + ad7edf6 commit 2896383

7 files changed

+20
-28
lines changed

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ RUN pip3 install --no-cache-dir --upgrade \
6868
# Install Python dependencies
6969
###
7070
RUN pip3 install --no-cache-dir --upgrade \
71-
https://github.com/cisagov/mongo-db-from-config/tarball/develop \
72-
pytz
71+
https://github.com/cisagov/mongo-db-from-config/tarball/develop
7372

7473
###
7574
# Put this just before we change users because the copy (and every

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ expects the secrets in a different location.
3333
To run the `cisagov/saver` image via Docker:
3434

3535
```console
36-
docker run cisagov/saver:1.3.4
36+
docker run cisagov/saver:1.3.5
3737
```
3838

3939
### Running with Docker Compose ###
@@ -46,7 +46,7 @@ docker run cisagov/saver:1.3.4
4646

4747
services:
4848
saver:
49-
image: cisagov/saver:1.3.4
49+
image: cisagov/saver:1.3.5
5050
volumes:
5151
- type: bind
5252
source: <your_log_dir>
@@ -92,7 +92,7 @@ environment variables. See the
9292
9393
services:
9494
trustymail_reporter:
95-
image: cisagov/saver:1.3.4
95+
image: cisagov/saver:1.3.5
9696
volumes:
9797
- type: bind
9898
source: <your_log_dir>
@@ -129,7 +129,7 @@ environment variables. See the
129129
1. Pull the new image:
130130

131131
```console
132-
docker pull cisagov/saver:1.3.4
132+
docker pull cisagov/saver:1.3.5
133133
```
134134

135135
1. Recreate and run the container by following the [previous instructions](#running-with-docker).
@@ -139,11 +139,11 @@ environment variables. See the
139139
The images of this container are tagged with [semantic
140140
versions](https://semver.org) of the underlying saver project that they
141141
containerize. It is recommended that most users use a version tag (e.g.
142-
`:1.3.4`).
142+
`:1.3.5`).
143143

144144
| Image:tag | Description |
145145
|-----------|-------------|
146-
|`cisagov/saver:1.3.4`| An exact release version. |
146+
|`cisagov/saver:1.3.5`| An exact release version. |
147147
|`cisagov/saver:1.3`| The most recent release matching the major and minor version numbers. |
148148
|`cisagov/saver:1`| The most recent release matching the major version number. |
149149
|`cisagov/saver:edge` | The most recent image built from a merge into the `develop` branch of this repository. |
@@ -206,8 +206,8 @@ Build the image locally using this git repository as the [build context](https:/
206206

207207
```console
208208
docker build \
209-
--build-arg VERSION=1.3.4 \
210-
--tag cisagov/saver:1.3.4 \
209+
--build-arg VERSION=1.3.5 \
210+
--tag cisagov/saver:1.3.5 \
211211
https://github.com/cisagov/saver.git#develop
212212
```
213213

@@ -237,9 +237,9 @@ Docker:
237237
docker buildx build \
238238
--file Dockerfile-x \
239239
--platform linux/amd64 \
240-
--build-arg VERSION=1.3.4 \
240+
--build-arg VERSION=1.3.5 \
241241
--output type=docker \
242-
--tag cisagov/saver:1.3.4 .
242+
--tag cisagov/saver:1.3.5 .
243243
```
244244

245245
## Contributing ##

src/create_sld_to_agency_name_and_id_mapping.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Standard Python Libraries
66
import csv
7-
import datetime
7+
from datetime import datetime, timezone
88
import os
99

1010
# Third-Party Libraries
@@ -63,7 +63,7 @@ def main():
6363
# Mongo 4 we can use a transaction to atomically (1) drop all the
6464
# rows from the collection and (2) use insert_many() to insert all
6565
# the new data. That will be much cleaner!
66-
now = datetime.datetime.utcnow()
66+
now = datetime.now(timezone.utc)
6767
with open(CURRENT_FEDERAL_FILE, newline="") as current_federal_file:
6868
csvreader = csv.DictReader(current_federal_file)
6969
for row in csvreader:

src/pshtt_csv2mongo.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Standard Python Libraries
66
import csv
7-
import datetime
7+
from datetime import datetime, time, timezone
88
import os
99
import re
1010

@@ -103,9 +103,7 @@ def store_data(clean_federal, agency_dict, db_config_file):
103103
:param db_config_file: The name of the file where the database
104104
configuration is stored
105105
"""
106-
date_today = datetime.datetime.combine(
107-
datetime.datetime.utcnow(), datetime.time.min
108-
)
106+
date_today = datetime.combine(datetime.now(timezone.utc), time.min)
109107
db = db_from_config(db_config_file) # set up database connection
110108
f = open(PSHTT_RESULTS_FILE)
111109
csv_f = csv.DictReader(f)

src/sslyze_csv2mongo.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
# Standard Python Libraries
66
import csv
7-
import datetime
7+
from datetime import datetime, time, timezone
88
import os
99

1010
# Third-Party Libraries
1111
from mongo_db_from_config import db_from_config
12-
from pytz import timezone
1312

1413
DB_CONFIG_FILE = "/run/secrets/scan_write_creds.yml"
1514
HOME_DIR = os.environ.get("CISA_HOME")
@@ -103,9 +102,7 @@ def store_data(clean_federal, agency_dict, db_config_file):
103102
:param db_config_file: The name of the file where the database
104103
configuration is stored
105104
"""
106-
date_today = datetime.datetime.combine(
107-
datetime.datetime.utcnow(), datetime.time.min
108-
)
105+
date_today = datetime.combine(datetime.now(timezone.utc), time.min)
109106
db = db_from_config(db_config_file) # set up database connection
110107
f = open(SSLYZE_RESULTS_FILE)
111108
csv_f = csv.DictReader(f)

src/trustymail_csv2mongo.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Standard Python Libraries
66
import csv
7-
import datetime
7+
from datetime import datetime, time, timezone
88
import os
99

1010
# Third-Party Libraries
@@ -101,9 +101,7 @@ def store_data(clean_federal, agency_dict, db_config_file):
101101
:param db_config_file: The name of the file where the database
102102
configuration is stored
103103
"""
104-
date_today = datetime.datetime.combine(
105-
datetime.datetime.utcnow(), datetime.time.min
106-
)
104+
date_today = datetime.combine(datetime.now(timezone.utc), time.min)
107105
db = db_from_config(db_config_file) # set up database connection
108106
f = open(TRUSTYMAIL_RESULTS_FILE)
109107
csv_f = csv.DictReader(f)

src/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3.4"
1+
__version__ = "1.3.5"

0 commit comments

Comments
 (0)