From: Thierry Parmentelat Date: Tue, 22 Nov 2011 15:12:42 +0000 (+0100) Subject: sfa settings : sfa_plc category split into sfa_plc and sfa_db X-Git-Tag: sfa-2.0-0~7 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=11156a540daa4b6ac2f6348f31f5f0d850161b2b sfa settings : sfa_plc category split into sfa_plc and sfa_db --- diff --git a/INSTALL.txt b/INSTALL.txt index cc59cebd..b93abaef 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -30,8 +30,8 @@ These four configuration parameters are required for SFA server configuration set SFA_PLC_USER to PLC_ROOT_USER set SFA_PLC_PASSWORD to PLC_ROOT_PASSWORD - set SFA_PLC_DB_USER to PLC_DB_USER - set SFA_PLC_DB_PASSWORD to PLC_DB_PASSWORD + set SFA_DB_USER to PLC_DB_USER + set SFA_DB_PASSWORD to PLC_DB_PASSWORD write and quit *NOTE* at this point you get a warning b/c the authorities hierarchy has not been created yet; ignore diff --git a/config/default_config.xml b/config/default_config.xml index 670d6f26..e633a60b 100644 --- a/config/default_config.xml +++ b/config/default_config.xml @@ -18,15 +18,6 @@ Thierry Parmentelat Basic system variables. - - Generic Flavour - pl - This string refers to a class located in sfa.generic that describes - which specific implementation needs to be used for api, manager and driver objects. - PlanetLab users do not need to change this setting. - - - Human readable name plc @@ -62,6 +53,15 @@ Thierry Parmentelat + + Generic Flavour + pl + This string refers to a class located in sfa.generic that describes + which specific implementation needs to be used for api, manager and driver objects. + PlanetLab users do not need to change this setting. + + + @@ -109,6 +109,42 @@ Thierry Parmentelat + + + Slice Manager + The settings that affect the slice manager that will run + as part of this SFA instance. + + + + Enable Slice Manager + true + Allows this local SFA instance to run as a + slice manager. + + + + Slice Manager type + pl + The type of backend server for this + slice manager. Not all slice managers are myplc. + + + + Hostname + localhost + The hostname where the slice manager is expected to + be found. + + + + Port number + 12347 + The port where the slice manager is to be found. + + + + Aggregate @@ -153,38 +189,42 @@ Thierry Parmentelat - - Slice Manager - The settings that affect the slice manager that will run - as part of this SFA instance. + + + The settings that tell this SFA instance where to find its database. You can essentially leave this as-is unless you plan on hosting your data on some other box. - - Enable Slice Manager - true - Allows this local SFA instance to run as a - slice manager. + + Database host + localhost + The host where the SFA database can be reached. - - Slice Manager type - pl - The type of backend server for this - slice manager. Not all slice managers are myplc. + + Database port + 5432 + The port where the SFA database can be reached. - - Hostname - localhost - The hostname where the slice manager is expected to - be found. + + Database user + pgsqluser + When SFA gets co-hosted with a myplc, this should match the PLC config. - - Port number - 12347 - The port where the slice manager is to be found. + + Database password + + When SFA gets co-hosted with a myplc, this should match the PLC config. + + + Database name + sfa + SFA database name. + + + @@ -212,39 +252,11 @@ Thierry Parmentelat Full URL of PLC interface. - - Database name - planetlab5 - Planetlab database name. - - - - Datbase host - localhost - The host where the PLC database can be reached. - - - - Database port - 5432 - The port where the PLC database can be reached. - - - - Database user - pgsqluser - - - - - Database password - - The password for PLC_DB_USER. - - + + SFA Flash Policy The settings that affect the flash policy server that will run diff --git a/config/sfa-config-tty b/config/sfa-config-tty index 9b2c439e..1e991630 100755 --- a/config/sfa-config-tty +++ b/config/sfa-config-tty @@ -18,12 +18,12 @@ usual_variables = [ "SFA_REGISTRY_HOST", "SFA_AGGREGATE_HOST", "SFA_SM_HOST", + "SFA_PLC_URL", "SFA_PLC_USER", "SFA_PLC_PASSWORD", - "SFA_PLC_DB_HOST", - "SFA_PLC_DB_USER", - "SFA_PLC_DB_PASSWORD", - "SFA_PLC_URL", + "SFA_DB_HOST", + "SFA_DB_USER", + "SFA_DB_PASSWORD", ] configuration={ \ diff --git a/sfa/util/PostgreSQL.py b/sfa/util/PostgreSQL.py index f16f48d7..de6f9fab 100644 --- a/sfa/util/PostgreSQL.py +++ b/sfa/util/PostgreSQL.py @@ -69,22 +69,22 @@ class PostgreSQL: if psycopg2: try: # Try UNIX socket first - self.connection = psycopg2.connect(user = self.config.SFA_PLC_DB_USER, - password = self.config.SFA_PLC_DB_PASSWORD, - database = self.config.SFA_PLC_DB_NAME) + self.connection = psycopg2.connect(user = self.config.SFA_DB_USER, + password = self.config.SFA_DB_PASSWORD, + database = self.config.SFA_DB_NAME) except psycopg2.OperationalError: # Fall back on TCP - self.connection = psycopg2.connect(user = self.config.SFA_PLC_DB_USER, - password = self.config.SFA_PLC_DB_PASSWORD, - database = self.config.SFA_PLC_DB_NAME, - host = self.config.SFA_PLC_DB_HOST, - port = self.config.SFA_PLC_DB_PORT) + self.connection = psycopg2.connect(user = self.config.SFA_DB_USER, + password = self.config.SFA_DB_PASSWORD, + database = self.config.SFA_DB_NAME, + host = self.config.SFA_DB_HOST, + port = self.config.SFA_DB_PORT) self.connection.set_client_encoding("UNICODE") else: - self.connection = pgdb.connect(user = self.config.SFA_PLC_DB_USER, - password = self.config.SFA_PLC_DB_PASSWORD, - host = "%s:%d" % (self.config.SFA_PLC_DB_HOST, self.config.SFA_PLC_DB_PORT), - database = self.config.SFA_PLC_DB_NAME) + self.connection = pgdb.connect(user = self.config.SFA_DB_USER, + password = self.config.SFA_DB_PASSWORD, + host = "%s:%d" % (self.config.SFA_DB_HOST, self.config.SFA_DB_PORT), + database = self.config.SFA_DB_NAME) (self.rowcount, self.description, self.lastrowid) = \ (None, None, None) diff --git a/sfa/util/config.py b/sfa/util/config.py index 14669160..2ad7f7b5 100644 --- a/sfa/util/config.py +++ b/sfa/util/config.py @@ -106,11 +106,11 @@ class Config: def get_plc_dbinfo(self): return { - 'dbname' : self.SFA_PLC_DB_NAME, - 'address' : self.SFA_PLC_DB_HOST, - 'port' : self.SFA_PLC_DB_PORT, - 'user' : self.SFA_PLC_DB_USER, - 'password' : self.SFA_PLC_DB_PASSWORD + 'dbname' : self.SFA_DB_NAME, + 'address' : self.SFA_DB_HOST, + 'port' : self.SFA_DB_PORT, + 'user' : self.SFA_DB_USER, + 'password' : self.SFA_DB_PASSWORD } # TODO: find a better place to put this method