Enable keystone token caching by OSC
SDK uses python keyring library to enable token caching. Normally this is requiring a proper desktop (interactive) session, but there are some backend plugins working in non-interactive mode. Store cache in an unencrypted file on FS (this is not worse than storing passwords in plaintext). Change-Id: I42d698f15db5918443073fff8f27b926126d1d0f
This commit is contained in:
3 changed files with 35 additions and 6 deletions
@@ -1047,6 +1047,8 @@ function get_or_create_service {
--description="3ドル" \
-f value -c id
)
# Drop cached token to invalidate catalog info in the token
remove_token_cache
echo $service_id
}
@@ -1064,7 +1066,6 @@ function _get_or_create_endpoint_with_interface {
endpoint_id=$(openstack --os-cloud devstack-system-admin endpoint create \
1ドル 2ドル 3ドル --region 4ドル -f value -c id)
fi
echo $endpoint_id
}
@@ -1088,6 +1089,8 @@ function get_or_create_endpoint {
if [[ -n "5ドル" ]]; then
_get_or_create_endpoint_with_interface 1ドル internal 5ドル 2ドル
fi
# Drop cached token to invalidate catalog info in the token
remove_token_cache
# return the public id to indicate success, and this is the endpoint most likely wanted
echo $public_id
}
@@ -2517,6 +2520,11 @@ function is_fips_enabled {
[ "$fips" == "1" ]
}
function remove_token_cache {
# Remove Keyring cache file
rm ~/.local/share/python_keyring/keyring_pass.cfg
}
# Restore xtrace
$_XTRACE_FUNCTIONS_COMMON
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.