<commit_before>#!/bin/bash
# track down a tenant by floating IP address

fip_address=$1

# print usage if variable isn't specified
if [[ $# -eq 0 ]]; then
        echo "USAGE: ./openstack-track-fip.sh \$IPADDRESS"
        echo "       ex: ./openstack-track-fip.sh 8.8.8.8"
        echo "                                          "
        exit 1
fi

# source keystonerc
source /root/keystonerc_admin

track_ip() {
        targrouter=$(neutron router-list | grep -w $fip_address | awk '{print $2}')

# if there's no fip, no need to look further
if [[ -z $targrouter ]]; then
	echo "IP address not found, or unassociated"
	echo "                                     "
	exit 1
fi
        targtenant=$(neutron router-show $targrouter | grep tenant_id | awk '{print $4}')
        targname=$(openstack project show $targtenant | grep name | awk '{print $4}')
        targmail=$(openstack user show $targname | grep email | awk '{print $4}')

cat << EndofMessage

########### OpenStack IP Sleuth 3000 ###########
#                                               
# $fip_address resolves to:                     
#                                               
#-----------------------------------------------
# Tenant   = $targtenant                        
# Username = $targname                          
# Email    = $targmail                          
#-----------------------------------------------
#                                               
################################################

To disable the account run from controller:
------------------------------------------------

source /root/keystonerc_admin
keystone user-set $targname --disable


EndofMessage
}

track_ip<commit_msg>update syntax to use newer osc commands<commit_after>#!/bin/bash
# track down a tenant by floating IP address

fip_address=$1

# print usage if variable isn't specified
if [[ $# -eq 0 ]]; then
        echo "USAGE: ./openstack-track-fip.sh \$IPADDRESS"
        echo "       ex: ./openstack-track-fip.sh 8.8.8.8"
        echo "                                          "
        exit 1
fi

# source keystonerc
source /root/keystonerc_admin

track_ip() {
        targrouter=$(neutron router-list | grep -w $fip_address | awk '{print $2}')

# if there's no fip, no need to look further
if [[ -z $targrouter ]]; then
	echo "IP address not found, or unassociated"
	echo "                                     "
	exit 1
fi
        targtenant=$(neutron router-show $targrouter | grep tenant_id | awk '{print $4}')
        targname=$(openstack project show $targtenant | grep name | awk '{print $4}')
        targmail=$(openstack user show $targname | grep email | awk '{print $4}')

cat << EndofMessage

########### OpenStack IP Sleuth 3000 ###########
#                                               
# $fip_address resolves to:                     
#                                               
#-----------------------------------------------
# Tenant   = $targtenant                        
# Username = $targname                          
# Email    = $targmail                          
#-----------------------------------------------
#                                               
################################################

To disable the account run from controller:
------------------------------------------------

source /root/keystonerc_admin
openstack user set $targname --disable


EndofMessage
}

track_ip
{'fraction_non_alphanumeric': 0.20666471791873722, 'fraction_numerical': 0.00935399006138556, 'mean_word_length': 1.3012777404169469, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4796114', 'n_tokens_mistral': 903, 'n_tokens_neox': 858, 'n_words': 256}