Browse code

Merge "Use sudo iniset to modify /etc files"

Jenkins authored on 2015/09/04 17:38:40
Showing 2 changed files
... ...
@@ -92,14 +92,12 @@ function configure_database_mysql {
92 92
 
93 93
     # Change bind-address from localhost (127.0.0.1) to any (::) and
94 94
     # set default db type to InnoDB
95
-    sudo bash -c "source $TOP_DIR/functions && \
96
-        iniset $my_conf mysqld bind-address "$SERVICE_LISTEN_ADDRESS" && \
97
-        iniset $my_conf mysqld sql_mode STRICT_ALL_TABLES && \
98
-        iniset $my_conf mysqld default-storage-engine InnoDB && \
99
-        iniset $my_conf mysqld max_connections 1024 && \
100
-        iniset $my_conf mysqld query_cache_type OFF && \
101
-        iniset $my_conf mysqld query_cache_size 0"
102
-
95
+    iniset -sudo $my_conf mysqld bind-address "$SERVICE_LISTEN_ADDRESS"
96
+    iniset -sudo $my_conf mysqld sql_mode STRICT_ALL_TABLES
97
+    iniset -sudo $my_conf mysqld default-storage-engine InnoDB
98
+    iniset -sudo $my_conf mysqld max_connections 1024
99
+    iniset -sudo $my_conf mysqld query_cache_type OFF
100
+    iniset -sudo $my_conf mysqld query_cache_size 0
103 101
 
104 102
     if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then
105 103
         echo_summary "Enabling MySQL query logging"
... ...
@@ -115,12 +113,10 @@ function configure_database_mysql {
115 115
 
116 116
         # Turn on slow query log, log all queries (any query taking longer than
117 117
         # 0 seconds) and log all non-indexed queries
118
-        sudo bash -c "source $TOP_DIR/functions && \
119
-            iniset $my_conf mysqld slow-query-log 1 && \
120
-            iniset $my_conf mysqld slow-query-log-file $slow_log && \
121
-            iniset $my_conf mysqld long-query-time 0 && \
122
-            iniset $my_conf mysqld log-queries-not-using-indexes 1"
123
-
118
+        iniset -sudo $my_conf mysqld slow-query-log 1
119
+        iniset -sudo $my_conf mysqld slow-query-log-file $slow_log
120
+        iniset -sudo $my_conf mysqld long-query-time 0
121
+        iniset -sudo $my_conf mysqld log-queries-not-using-indexes 1
124 122
     fi
125 123
 
126 124
     restart_service $mysql
... ...
@@ -559,7 +559,7 @@ function configure_tempest {
559 559
 
560 560
     if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
561 561
         # Use the ``BOTO_CONFIG`` environment variable to point to this file
562
-        iniset $BOTO_CONF Boto ca_certificates_file $SSL_BUNDLE_FILE
562
+        iniset -sudo $BOTO_CONF Boto ca_certificates_file $SSL_BUNDLE_FILE
563 563
         sudo chown $STACK_USER $BOTO_CONF
564 564
     fi
565 565