Просмотр исходного кода

style: make elvis and shellcheck happy

JimMoen 2 лет назад
Родитель
Сommit
f8c0aa49a2

+ 4 - 2
lib-ee/emqx_ee_connector/src/emqx_ee_connector_sqlserver.erl

@@ -342,9 +342,11 @@ do_get_status(Conn, RequestTimeout) ->
 %% About the connection string attribute `Encrypt`:
 %% The default value is `yes` in odbc version 18.0+ and `no` in previous versions.
 %% And encrypted connections always verify the server's certificate.
-%% So `Encrypt=YES;TrustServerCertificate=YES` must be set in the connection string when connecting to a server that has a self-signed certificate.
+%% So `Encrypt=YES;TrustServerCertificate=YES` must be set in the connection string
+%% when connecting to a server that has a self-signed certificate.
 %% See also:
-%% https://learn.microsoft.com/en-us/sql/connect/odbc/dsn-connection-string-attribute?source=recommendations&view=sql-server-ver16#encrypt
+%% 'https://learn.microsoft.com/en-us/sql/connect/odbc/
+%%      dsn-connection-string-attribute?source=recommendations&view=sql-server-ver16#encrypt'
 conn_str([], Acc) ->
     %% we should use this for msodbcsql 18+
     %% lists:join(";", ["Encrypt=YES", "TrustServerCertificate=YES" | Acc]);

+ 4 - 3
scripts/install-odbc-driver.sh

@@ -5,14 +5,15 @@
 set -euo pipefail
 
 # install msodbcsql17
-if ! [[ "16.04 18.04 20.04 22.04" == *"$(lsb_release -rs)"* ]];
+VERSION=$(lsb_release -rs)
+if ! [[ "16.04 18.04 20.04 22.04" == *"$VERSION"* ]];
 then
-    echo "Ubuntu $(lsb_release -rs) is not currently supported.";
+    echo "Ubuntu $VERSION is not currently supported.";
     exit 1;
 fi
 
 curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
-curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
+curl https://packages.microsoft.com/config/ubuntu/"$VERSION"/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
 ## TODO: upgrade builder image
 apt-get update && \
 ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev mssql-tools && \