Skip to content

Commit

Permalink
show-powershel added to allas_conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimmo Mattila committed Mar 22, 2024
1 parent 455906a commit dd54368
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions allas_conf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ Usage: source allas_conf [OPTIONS] [PROJECT]
-f, --force Skip check that tries to ensure that this command is
sourced correctly. This option needs to be used in batch jobs.
--s3remove Remove S3 access key for an Allas project.
--s3remove Remove S3 access key for an Allas project.
--show-powershell After configuration, show swift authentication related environment
variables in format that can be used to enable Rclone
connection to Allas in Windows PowerShell.
DEPENDENCIES
------------
Expand Down Expand Up @@ -129,6 +134,7 @@ local ood=false
#project_list_method options are curl and openstack
local project_list_method=curl
local sd_connect=false
local show_powershell=false

# Process command line arguments

Expand All @@ -149,6 +155,7 @@ while [[ $# -ge 1 ]]; do
'--store-token' ) ood=true; shift;;
'--lumi') mode="lumi"; shift;;
'--sd' ) sd_connect=true; keep_password=true; shift;;
'--show-powershell' ) show_powershell=true; shift;;
'-p'|'--project' )
if [[ -z $2 ]]; then
if [[ ${2::1} != "-" ]];then
Expand Down Expand Up @@ -276,7 +283,6 @@ if [[ $mode == "lumi" ]]; then
echo "secret_access_key = $S3_SECRET_ACCESS_KEY" >> "$rconf"
echo 'endpoint = https://lumidata.eu' >> "$rconf"
echo 'acl = public-read' >> "$rconf"

echo "rclone remote lumi-pub: now provides an S3 based connection to Lumi-O storage area of project $lumi_project_number."
echo ""

Expand Down Expand Up @@ -575,7 +581,7 @@ if $use_swift; then
echo "Using $sd_server"
echo "With project $OS_PROJECT_NAME"
echo "And token: $SD_CONNECT_API_TOKEN"
fi
fi
fi


Expand Down Expand Up @@ -713,8 +719,25 @@ if ! $keep_password; then
unset OS_IDENTITY_API_VERSION
fi


# Show OS_ environment variables in Windows PowerShell format
if [[ $show_powershell ]]; then
echo ""
echo "--------------------------------------------------------------"
echo "Allas autentication parameters in Windows PowerShell format."
echo "If your Windows mahcine has Rclone installed and allas endpoint"
echo "configured. Use the commands below to activate your allas endpoint."
echo ""
echo "--------------------------------------------------------------"
env | grep OS_ | awk -F "=" '{ if ( $2 != "") print "$Env:"$1" = \""$2 "\""}'
fi



}



function rclone() {
if [[ "$1" = 'info' ]]; then
echo 'Do not use rclone command "info"' >&2
Expand Down

0 comments on commit dd54368

Please sign in to comment.