From 6648a2d7bfaf981cb401403eb9b4b717abda6f9f Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 30 May 2011 14:34:42 +0300 Subject: [PATCH] DB store plugin params unified --- .../etc/stargazer/conf-available.d/store_mysql.conf | 10 +++++----- .../etc/stargazer/conf-available.d/store_mysql.conf | 10 +++++----- .../stargazer/plugins/store/mysql/mysql_store.cpp | 12 ++++++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf b/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf index 475b5f27..4cd2c0de 100644 --- a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf +++ b/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf @@ -3,23 +3,23 @@ # Parameter: required # Value: IP address or DNS name # Default: localhost - dbhost = localhost + server = localhost # Database name # Parameter: required # Value: any, supported by database # Default: stg - dbname = stg + database = stg # Database username # Parameter: required # Value: any, supported by database # Default: stg - dbuser = stg + user = stg # Database password # Parameter: required # Value: any, supported by database # Default: 123456 - rootdbpass = 123456 - \ No newline at end of file + password = 123456 + diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf b/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf index 475b5f27..4cd2c0de 100644 --- a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf +++ b/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf @@ -3,23 +3,23 @@ # Parameter: required # Value: IP address or DNS name # Default: localhost - dbhost = localhost + server = localhost # Database name # Parameter: required # Value: any, supported by database # Default: stg - dbname = stg + database = stg # Database username # Parameter: required # Value: any, supported by database # Default: stg - dbuser = stg + user = stg # Database password # Parameter: required # Value: any, supported by database # Default: 123456 - rootdbpass = 123456 - \ No newline at end of file + password = 123456 + diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/projects/stargazer/plugins/store/mysql/mysql_store.cpp index ac5818d5..54e13f86 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/projects/stargazer/plugins/store/mysql/mysql_store.cpp @@ -153,13 +153,17 @@ return 0; //----------------------------------------------------------------------------- int MYSQL_STORE_SETTINGS::ParseSettings(const MODULE_SETTINGS & s) { -if (ParseParam(s.moduleParams, "dbuser", dbUser) < 0) +if (ParseParam(s.moduleParams, "user", dbUser) < 0 && + ParseParam(s.moduleParams, "dbuser", dbUser) < 0) return -1; -if (ParseParam(s.moduleParams, "rootdbpass", dbPass) < 0) +if (ParseParam(s.moduleParams, "password", dbPass) < 0 && + ParseParam(s.moduleParams, "rootdbpass", dbPass) < 0) return -1; -if (ParseParam(s.moduleParams, "dbname", dbName) < 0) +if (ParseParam(s.moduleParams, "database", dbName) < 0 && + ParseParam(s.moduleParams, "dbname", dbName) < 0) return -1; -if (ParseParam(s.moduleParams, "dbhost", dbHost) < 0) +if (ParseParam(s.moduleParams, "server", dbHost) < 0 && + ParseParam(s.moduleParams, "dbhost", dbHost) < 0) return -1; return 0; -- 2.44.2