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

🐛 Change the way in which we read the configuration variables #979

Merged
merged 1 commit into from
Sep 12, 2024

Commits on Sep 11, 2024

  1. 🐛 Change the way in which we read the configuration variables

    The changes made to support the new configuration methodology failed with this error
    
    ```
    ERROR:root:name 'os' is not defined
    Traceback (most recent call last):
      File "/usr/src/app/emission/net/ext_service/push/notify_interface.py", line 27, in <module>
        logging.warning(f"Push configured for app {push_config.get('PUSH_APP_PACKAGE_NAME')} using platform {os.getenv('PUSH_PROVIDER')} with token {os.getenv('PUSH_SERVER_AUTH_TOKEN')[:10]}... of length {len(os.getenv('PUSH_SERVER_AUTH_TOKEN'))}")
    NameError: name 'os' is not defined
    ```
    
    The fix is simply to use `push_config.get` instead of `os.getenv`. Also logged
    the full exception instead of simply generating a warning that the functionality is not supported.
    
    Testing done:
    - Before: error above
    - After:
    
    ```
    Found configuration, overriding...
    Activating the environment...
    Run trip labeling reminder...
    WARNING:root:About to read push configuration...
    WARNING:root:Push configured for app gov.nrel.cims.openpath using platform firebase with token ... of length 152
    ```
    shankari committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    6eac178 View commit details
    Browse the repository at this point in the history