Commit c19d8748 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

remove custom hack

parent e946e8f5
......@@ -2,12 +2,76 @@
import yaml
from peewee import OperationalError
# Tower modules
from tower.models.env_legacy import Environment
from peewee import (Model, CharField, TextField, ForeignKeyField,
DateTimeField, BooleanField, IntegerField)
def migrate(migrator):
class Environment(Model):
class Meta:
database = migrator.db
db_table = "environment"
name = CharField(unique=True)
description = TextField()
#
env_type = CharField(
default="eval",
choices=[
("prod", "Productive"),
("test", "Test"),
("dev", "Develop"),
("eval", "Evaluation"),
("other", "Other")
]
)
# Installation name as shown in interface header
installation_name = CharField(default="Unconfigured installation")
# NOC system user
sys_user = CharField(default="noc")
# NOC system group
sys_group = CharField(default="noc")
# Default installation prefix
sys_prefix = CharField(default="/opt/noc")
# Repo settings
repo = CharField(default="https://bitbucket.org/nocproject/noc")
branch = CharField(default="default")
changeset = CharField(default="tip")
# Custom repo settings
custom_enabled = BooleanField(default=True)
custom_repo = CharField(default="")
custom_branch = CharField(default="default")
custom_changeset = CharField(default="tip")
metrics_collector = CharField(default="")
# Web settings
web_host = CharField(default="127.0.0.1:8000")
cert = TextField(default="")
# @todo: Certificate
# PostgreSQL settings
pg_db = CharField(default="noc")
pg_user = CharField(default="noc")
pg_password = CharField(default="noc")
# MongoDB settins
mongo_db = CharField(default="noc")
mongo_user = CharField(default="noc")
mongo_password = CharField(default="noc")
mongo_rs = CharField(default="noc")
mongo_engine = CharField(
default="wiredTiger",
choices=[
("wiredTiger", "WiredTiger"),
("mmapv1", "MMAPv1")
]
)
# InfluxDB settings
influxdb_db = CharField(default="noc")
influxdb_user = CharField(default="noc")
influxdb_password = CharField(default="noc")
# json-serialized service configuration
# pool id -> service -> key -> value
service_config = TextField(default="")
is_default = BooleanField(default=False)
for env in Environment.select():
config = yaml.load(env.service_config)
if "session_ttl" in config[None]["login"]:
......
This diff is collapsed.
Supports Markdown
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