Patching Dec 9, 2021 6-7a CST- All GitLab services may be unavailable for 5-10 minutes

Commit 1ff4ff39 authored by Peter Hartman's avatar Peter Hartman
Browse files

devel 08/2/21 11:17am

added added temp config_dir
parent b3808718
#!/usr/bin/env python3
#
# This is the project on-boarding script for Taiga
#
......@@ -20,7 +21,8 @@ import os
import yaml
from os import path
config_file = "/etc/settool.conf"
#config_file = "/etc/settool.conf"
config_file = "/home/pehartma/git/project_onboard/etc/settool.conf"
@click.group(invoke_without_command=True)
......@@ -50,7 +52,7 @@ def get_settings():
def setup_setup():
msg = "File " + config_file + "not found. Create? (y/n)"
msg = "File " + config_file + " not found. Create? (y/n)"
response = input(msg)
if response.lower() == "y":
with open(config_file, mode="w") as cf_fp:
......@@ -72,6 +74,15 @@ def check_setup():
print(exc)
else:
setup_setup()
if path.exists(config_file):
with open(config_file, mode="a") as conf_fp:
try:
conf_yaml = yaml.safe_load(conf_fp)
except yaml.YAMLError as exc:
print(exc)
else:
print("file creation incorrect")
exit()
if "working_dir" not in conf_yaml.keys():
setup_setup()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment