Skip to content
Snippets Groups Projects
Commit 517da8b8 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Try priviledge escalation

parent 86b41dae
Branches
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ import common_config
from common_config import initialize_config, read_settings, main
# Name of this application, used in directory names, etc
APPLICATION_NAME = "eigenservice"
APPLICATION_NAME = "my_application"
# suffix added to the config files (e.g. `00-suffix.toml`)
SUFFIX = "config"
......
__version__ = '0.1.3'
__version__ = '0.1.4'
from common_config.common import *
\ No newline at end of file
......@@ -389,7 +389,9 @@ def create_config():
print("Error: Didn't have the permissions to create the config directory at {}".format(selection["path"]), file=sys.stderr)
print("Hint: Change the owner of the directory temporarily to {} or run {} config create with more permissions".format(getpass.getuser(), APPLICATION_NAME))
subprocess.call(['sudo', 'python3', *sys.argv])
# Run again with priviledges
python_path = f"{sys.prefix}/bin/python3"
subprocess.call(['sudo', python_path, *sys.argv])
sys.exit()
config_path = Path(f"{selection['path']}/00-{SUFFIX}.toml")
......
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import common_config
from common_config import initialize_config, read_settings, main
# Name of this application, used in directory names, etc
APPLICATION_NAME = "my_application"
# suffix added to the config files (e.g. `00-suffix.toml`)
SUFFIX = "config"
# Do not change here, just use an override instead
DEFAULT_CONFIG = """
[application]
loglevel = "info"
level = 9001
mood = "very"
"""
# Override the global variables in the common-config.common module
common_config.common.APPLICATION_NAME = APPLICATION_NAME
common_config.common.SUFFIX = SUFFIX
common_config.common.DEFAULT_CONFIG = DEFAULT_CONFIG
if __name__ == "__main__":
main()
[tool.poetry]
name = "common-config"
version = "0.1.3"
version = "0.1.4"
description = "A config library for eigenservice"
authors = ["David Huss <dh@atoav.com>"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment