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

replace naz json config file with a python file. #104

Closed
komuw opened this issue May 23, 2019 · 1 comment · Fixed by #123
Closed

replace naz json config file with a python file. #104

komuw opened this issue May 23, 2019 · 1 comment · Fixed by #123

Comments

@komuw
Copy link
Owner

komuw commented May 23, 2019

the current config file is a json file like;

{
    "smsc_host": "127.0.0.1",
    "smsc_port": 2775,
    "system_id": "smppclient1",
    "password": "password",
    "loglevel": "INFO"
}

There are times when you want(as an example) to fetch the password from an external security storage facility like AWS param store.
In such a case fetching the param and adding it to the config file is a hustle.

However if the config file was a normal python file, then;

MY_PASSWORD = boto3.ssm.get("/myapp/password")

{
    "smsc_host": "127.0.0.1",
    "smsc_port": 2775,
    "system_id": "smppclient1",
    "password":  MY_PASSWORD,
    "loglevel": "INFO"
}
@komuw
Copy link
Owner Author

komuw commented May 27, 2019

while at it remove cli --loglevel option;

naz/cli/cli.py

Lines 79 to 87 in 0dd7bc8

parser.add_argument(
"--loglevel",
type=str,
required=False,
default="INFO",
choices=["NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
help="The log level to output log messages at. \
eg: --loglevel DEBUG",
)

the one in config file should reign supreme

@komuw komuw mentioned this issue May 31, 2019
@komuw komuw closed this as completed in #123 Jun 1, 2019
komuw added a commit that referenced this issue Jun 1, 2019
What:
- replace naz json config file with a python file.

Why:
- It makes the code for naz to handle config files much easier
- it can also be much easier for app developers to do some things.
- Fixes: #104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant