Skip to content

Commit

Permalink
Don't redundantly chown the configuration file, and move the --config…
Browse files Browse the repository at this point in the history
…-file option to st2 instead of the login subcommand
  • Loading branch information
blag committed Jun 21, 2018
1 parent de8a668 commit 2c2cad3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions scripts/includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ configure_st2_cli_config() {
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"

sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
login --write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
Expand All @@ -191,8 +191,8 @@ configure_st2_cli_config() {
fi

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

# Fix the permissions
Expand Down
8 changes: 4 additions & 4 deletions scripts/st2bootstrap-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ configure_st2_cli_config() {
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"

sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
login --write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
Expand All @@ -308,8 +308,8 @@ configure_st2_cli_config() {
fi

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

# Fix the permissions
Expand Down
8 changes: 4 additions & 4 deletions scripts/st2bootstrap-el6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ configure_st2_cli_config() {
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"

sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
login --write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
Expand All @@ -303,8 +303,8 @@ configure_st2_cli_config() {
fi

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

# Fix the permissions
Expand Down
8 changes: 4 additions & 4 deletions scripts/st2bootstrap-el7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ configure_st2_cli_config() {
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"

sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
login --write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
Expand All @@ -303,8 +303,8 @@ configure_st2_cli_config() {
fi

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

# Fix the permissions
Expand Down

0 comments on commit 2c2cad3

Please sign in to comment.