Skip to content

Commit

Permalink
Merge branch 'style-reformat' into 'master'
Browse files Browse the repository at this point in the history
Reformat and fix YAML and python code

See merge request webservices/mtg-sift!166
  • Loading branch information
djhoese committed May 12, 2023
2 parents 487887b + 08ad953 commit bde53eb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion etc/SIFT/config/auto_update.yaml
Expand Up @@ -6,4 +6,4 @@ auto_update:
interval: 20

data_reading:
merge_with_existing: False # shall be activated only with active auto_update
merge_with_existing: False # shall be activated only with active auto_update
2 changes: 1 addition & 1 deletion etc/SIFT/config/readers/li_l1b_bck_nc_sift.yaml
Expand Up @@ -7,4 +7,4 @@ data_reading:
'{pflag}_{location_indicator},{data_designator},MTGI{spacecraft_id}+LI-1B-BCK--{subtype}--{component1}-{component2}-{component3}-{purpose}-{format}_{oflag}_{originator}_{processing_time:%Y%m%d%H%M%S}_{facility_or_tool}_{environment}_{start_time:%Y%m%d%H%M%S}_{end_time:%Y%m%d%H%M%S}_{processing_mode}_{special_compression}_{disposition_mode}_{repeat_cycle_in_day:>04d}_{count_in_repeat_cycle:>04d}.nc',
]
geometry_definition: SwathDefinition
kind: 'IMAGE'
kind: 'IMAGE'
2 changes: 1 addition & 1 deletion etc/SIFT/config/readers/li_l2_a_nc_sift.yaml
Expand Up @@ -8,4 +8,4 @@ data_reading:
]
geometry_definition: AreaDefinition
reader_kwargs:
with_area_definition: True
with_area_definition: True
2 changes: 1 addition & 1 deletion etc/SIFT/config/readers/modis_l1b.yaml
@@ -1,3 +1,3 @@
data_reading:
modis_l1b:
geometry_definition: SwathDefinition
geometry_definition: SwathDefinition
2 changes: 1 addition & 1 deletion etc/SIFT/config/readers/seviri_l2_grib.yaml
Expand Up @@ -10,4 +10,4 @@ data_reading:
grid:
origin: "SE"
first_index_x: 1
first_index_y: 1
first_index_y: 1
8 changes: 4 additions & 4 deletions uwsift/util/storage_agent.py
Expand Up @@ -4,7 +4,7 @@
import random
import shlex
import string
import subprocess
import subprocess # nosec: B404
import time
from datetime import datetime, timedelta
from itertools import chain
Expand All @@ -14,7 +14,7 @@
import appdirs
from donfig import Config

from uwsift.util.default_paths import APPLICATION_NAME, APPLICATION_AUTHOR
from uwsift.util.default_paths import APPLICATION_AUTHOR, APPLICATION_NAME

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -87,7 +87,7 @@ def _notify(self, level: int, text: str) -> None:
cmd = f"{self.notification_cmd}" f" {machine} {process_name} {severity} {text}"

try:
subprocess.run(cmd, shell=True, check=True)
subprocess.run(cmd, shell=True, check=True) # nosec: 602
except subprocess.CalledProcessError as err:
LOG.error(f"Can't run the notification command: {err}")
LOG.log(level, text)
Expand All @@ -105,7 +105,7 @@ def _check_write_access(self, dir_path: str, attempts: int = 5) -> bool:
for _ in range(attempts):
# don't use upper and lower case because NTFS/Windows is case insensitive
char_set = string.ascii_lowercase + string.digits
random_name = "".join(random.choices(char_set, k=25))
random_name = "".join(random.choices(char_set, k=25)) # nosec: B311
path = os.path.join(dir_path, random_name)

try:
Expand Down
6 changes: 3 additions & 3 deletions uwsift/util/watchdog.py
Expand Up @@ -4,7 +4,7 @@
import os
import shlex
import signal
import subprocess
import subprocess # nosec: B404
from datetime import datetime, timedelta, timezone
from socket import gethostname
from time import sleep
Expand All @@ -14,7 +14,7 @@
from donfig import Config
from psutil import NoSuchProcess, Process

from uwsift.util.default_paths import APPLICATION_NAME, APPLICATION_AUTHOR
from uwsift.util.default_paths import APPLICATION_AUTHOR, APPLICATION_NAME

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -152,7 +152,7 @@ def _notify(self, level: int, text: str):
cmd = [self.notification_cmd, machine, process_name, severity, text]

try:
subprocess.run(cmd, shell=True, check=True)
subprocess.run(cmd, shell=True, check=True) # nosec: B602
except subprocess.CalledProcessError as err:
LOG.error(f"Can't run the notification command: {err}")
LOG.log(level, text)
Expand Down

0 comments on commit bde53eb

Please sign in to comment.