odoo/setup/lib/environments.py

36 lines
1.5 KiB
Python

# -*- coding: utf-8 -*-
class Environment():
def __init__(self, host, port, dbname, username, pwd=None, super_admin_pw=None, basic_auth=None):
self.host = host
self.port = port
self.dbname = dbname
self.username = username
# The password for the user named username
# During create the user is created with this password,
# otherwise it's used to authenticate during login.
self.pwd = pwd
self.super_admin_pw = super_admin_pw
# HTTP authentication
self.basic_auth = basic_auth or ('user', 'pass')
def __str__(self):
return """==============================
Host: %s
User: %s
DB: %s
Port: %s
==============================""" % (self.host, self.username, self.dbname, self.port)
ENVIRONMENTS = {
# Local environments are listed with passwords
'br': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
'sk': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
'ha': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
'jb': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
'uk': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
# Remote environments are always listed without passwords!
# Do not store them here, you have to type them anyway!
'test': Environment('https://INSTANCE.camadeus.at', '443', 'INSTANCE_1', 'admin'),
}