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

Commit 21a8dfe7 authored by Peter Hartman's avatar Peter Hartman
Browse files

devel 08/2/21 11:20am

print settings
parent 31993269
#!/usr/bin/env python3
#
# This is the project on-boarding script for Taiga
#
# It's purpose is to perform the tasks necessary to put a new project into Taiga
#
# Service ticket: https://jira.ncsa.illinois.edu/browse/SVC-3145
#
# Tasks:
# 1) Creation of directory
# 2) Set quota
# 3) Assign owner:group
# 4) Ensure owner:group exists
# 6) assign certain dirs to MDTs
import click
import os
import yaml
from os import path
#config_file = "/etc/settool.conf"
config_file = "/home/pehartma/git/project_onboard/etc/settool.conf"
@click.group(invoke_without_command=True)
def cli():
check_setup()
@cli.command()
def report():
pass
@cli.command()
def add_base():
pass
@cli.command()
def add_project():
pass
def get_settings():
settings = []
settings["working_dir"] = "Not Set"
return settings
def setup_setup():
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:
settings = get_settings()
print(settings)
if "working_dir" not in settings:
print("Entry incorrect")
exit()
else:
data = {"working_dir": settings["working_dir"]}
yaml.dump(data, cf_fp)
def check_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:
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()
def make_project(project_path, project_name):
pass
if __name__ == '__main__':
cli()
#!/usr/bin/env python3
#
# This is the project on-boarding script for Taiga
#
# It's purpose is to perform the tasks necessary to put a new project into Taiga
#
# Service ticket: https://jira.ncsa.illinois.edu/browse/SVC-3145
#
# Tasks:
# 1) Creation of directory
# 2) Set quota
# 3) Assign owner:group
# 4) Ensure owner:group exists
# 6) assign certain dirs to MDTs
import click
import os
import yaml
from os import path
#config_file = "/etc/settool.conf"
config_file = "/home/pehartma/git/project_onboard/etc/settool.conf"
@click.group(invoke_without_command=True)
def cli():
check_setup()
@cli.command()
def report():
pass
@cli.command()
def add_base():
pass
@cli.command()
def add_project():
pass
def get_settings():
settings = []
settings["working_dir"] = "Not Set"
return settings
def setup_setup():
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:
settings = get_settings()
print(settings)
if "working_dir" not in settings:
print("Entry incorrect")
exit()
else:
data = {"working_dir": settings["working_dir"]}
yaml.dump(data, cf_fp)
def check_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:
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()
def make_project(project_path, project_name):
pass
if __name__ == '__main__':
cli()
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