From bf06289c280bafd557c9a9d34ce77d8d18fd2ff8 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 13 Dec 2022 10:38:54 -0500 Subject: [PATCH] fix coding norm check in `hosts.py` (#1174) `pynorms` test is trapping a error in `hosts.py` on the conditional for singularity container that is now fixed. Also start ignoring git hidden directories from pynorms. --- .github/workflows/pynorms.yaml | 2 +- workflow/hosts.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pynorms.yaml b/.github/workflows/pynorms.yaml index 6f9046c734..3d90e9b221 100644 --- a/.github/workflows/pynorms.yaml +++ b/.github/workflows/pynorms.yaml @@ -21,4 +21,4 @@ jobs: - name: Run pycodestyle run: | cd $GITHUB_WORKSPACE/global-workflow - pycodestyle -v --config ./.pycodestyle . + pycodestyle -v --config ./.pycodestyle --exclude='.git,.github' ./ diff --git a/workflow/hosts.py b/workflow/hosts.py index ee9510df9e..b97ac67d89 100644 --- a/workflow/hosts.py +++ b/workflow/hosts.py @@ -32,7 +32,7 @@ def __init__(self, host=None): def detect(cls): machine = 'NOTFOUND' - container = os.getenv('SINGULARITY_NAME') + container = os.getenv('SINGULARITY_NAME', None) if os.path.exists('/scratch1/NCEPDEV'): machine = 'HERA' @@ -44,7 +44,7 @@ def detect(cls): machine = 'WCOSS2' elif os.path.exists('/data/prod'): machine = 'S4' - elif container != None: + elif container is not None: machine = 'CONTAINER' if machine not in Host.SUPPORTED_HOSTS: