Skip to content

Commit

Permalink
Spell correction and script fix.
Browse files Browse the repository at this point in the history
Features: control telemetry

Required-githooks: true

Signed-off-by: Samir Raval <[email protected]>
  • Loading branch information
ravalsam committed Sep 30, 2024
1 parent a3bcfc9 commit d3f9941
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/control/lib/control/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func httpGetBody(ctx context.Context, url *url.URL, get httpGetFn, timeout time.

cert, err := ioutil.ReadFile(*cacertpath)
if err != nil {
return nil, errors.Wrap(err, "reading CA cerificate file Error")
return nil, errors.Wrap(err, "reading CA certificate file Error")
}

get, err = httpsGetFunc(cert)
Expand Down
2 changes: 1 addition & 1 deletion src/control/lib/control/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func TestControl_httpGetBody(t *testing.T) {
Body: newMockReadCloser("this is the body of an HTTP response"),
}, nil
},
expErr: errors.New("reading CA cerificate file Error: open wrongpath/notavailable.crt: no such file or directory"),
expErr: errors.New("reading CA certificate file Error: open wrongpath/notavailable.crt: no such file or directory"),
},
"reading body fails": {
url: defaultURL,
Expand Down
2 changes: 0 additions & 2 deletions utils/certs/gen_telemetry_admin_certificate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ function print_usage () {
DAYS=1095

CA_HOME="${1:-.}/daosTelemetryCA"
# shellcheck disable=SC2128
CONFIGS="$(dirname "${BASH_SOURCE}")"

function setup_directories () {
mkdir -p "${CA_HOME}"
Expand Down
8 changes: 4 additions & 4 deletions utils/certs/gen_telemetry_server_certificate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Please modify to use in Production environment.
Usage: gen_telemetry_server_certificate.sh [USER] [DIR]
USER: DAOS has server and client and the certificate need the specific file permission
based on system usage.
Use "daos_server" if running script on server
Use "daos_agent" if running script on client
Use daos_server if running script on server
Use daos_agent if running script on client
DIR: Generate telemetry certificates for DAOS metrics in the [DIR].
By default [DIR] is the current directory.
Expand Down Expand Up @@ -53,7 +53,7 @@ function generate_server_cert () {
echo "Generating Server Certificate"
# Generate Private key and set its permissions
openssl genrsa -out "${CA_HOME}/telemetryserver.key" 2048
[[ $EUID -eq 0 ]] && chown ${USER}.${USER} "${CA_HOME}/telemetryserver.key"
[[ $EUID -eq 0 ]] && chown "${USER}"."${USER}" "${CA_HOME}/telemetryserver.key"
chmod 0400 "${CA_HOME}/telemetryserver.key"

# Generate a Certificate Signing Request (CRS)
Expand All @@ -65,7 +65,7 @@ function generate_server_cert () {
-CAkey "${CA_HOME}/daosTelemetryCA.key" -CAcreateserial -out "${CA_HOME}/telemetryserver.crt" \
-days ${DAYS} -sha256 -extfile "$CA_HOME/telemetry.cnf" -extensions v3_ext

[[ $EUID -eq 0 ]] && chown ${USER}.${USER} "${CA_HOME}/telemetryserver.crt"
[[ $EUID -eq 0 ]] && chown "${USER}"."${USER}" "${CA_HOME}/telemetryserver.crt"
chmod 0644 "${CA_HOME}/telemetryserver.crt"

echo "Required Server Certificate Files:
Expand Down

0 comments on commit d3f9941

Please sign in to comment.