Skip to content

Commit 2c2cad3

Browse files
committed
Don't redundantly chown the configuration file, and move the --config-file option to st2 instead of the login subcommand
1 parent de8a668 commit 2c2cad3

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

scripts/includes/common.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ configure_st2_cli_config() {
181181
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
182182
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"
183183

184-
sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
185-
--write-password \
184+
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
185+
login --write-password \
186186
--username ${USERNAME} --password ${PASSWORD}
187187

188188
# Write config for root user
@@ -191,8 +191,8 @@ configure_st2_cli_config() {
191191
fi
192192

193193
# Write config for current user (in case current user != root)
194-
st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
195-
--write-password \
194+
st2 --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
195+
login --write-password \
196196
--username ${USERNAME} --password ${PASSWORD}
197197

198198
# Fix the permissions

scripts/st2bootstrap-deb.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ configure_st2_cli_config() {
298298
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
299299
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"
300300

301-
sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
302-
--write-password \
301+
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
302+
login --write-password \
303303
--username ${USERNAME} --password ${PASSWORD}
304304

305305
# Write config for root user
@@ -308,8 +308,8 @@ configure_st2_cli_config() {
308308
fi
309309

310310
# Write config for current user (in case current user != root)
311-
st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
312-
--write-password \
311+
st2 --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
312+
login --write-password \
313313
--username ${USERNAME} --password ${PASSWORD}
314314

315315
# Fix the permissions

scripts/st2bootstrap-el6.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ configure_st2_cli_config() {
293293
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
294294
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"
295295

296-
sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
297-
--write-password \
296+
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
297+
login --write-password \
298298
--username ${USERNAME} --password ${PASSWORD}
299299

300300
# Write config for root user
@@ -303,8 +303,8 @@ configure_st2_cli_config() {
303303
fi
304304

305305
# Write config for current user (in case current user != root)
306-
st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
307-
--write-password \
306+
st2 --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
307+
login --write-password \
308308
--username ${USERNAME} --password ${PASSWORD}
309309

310310
# Fix the permissions

scripts/st2bootstrap-el7.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ configure_st2_cli_config() {
293293
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
294294
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"
295295

296-
sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
297-
--write-password \
296+
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
297+
login --write-password \
298298
--username ${USERNAME} --password ${PASSWORD}
299299

300300
# Write config for root user
@@ -303,8 +303,8 @@ configure_st2_cli_config() {
303303
fi
304304

305305
# Write config for current user (in case current user != root)
306-
st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
307-
--write-password \
306+
st2 --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
307+
login --write-password \
308308
--username ${USERNAME} --password ${PASSWORD}
309309

310310
# Fix the permissions

0 commit comments

Comments
 (0)