Merge "ovn migration: Fix check for stack name"
This commit is contained in:
commit
da44b19aac
@ -146,6 +146,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Generate the inventory file for ansible migration playbook.
|
# Generate the inventory file for ansible migration playbook.
|
||||||
|
# It uses tripleo-ansible-inventory.yaml which was used during deployment as source inventory
|
||||||
generate_ansible_inventory_file() {
|
generate_ansible_inventory_file() {
|
||||||
local dhcp_nodes
|
local dhcp_nodes
|
||||||
local inventory_file="$OOO_WORKDIR/$STACK_NAME/config-download/$STACK_NAME/tripleo-ansible-inventory.yaml"
|
local inventory_file="$OOO_WORKDIR/$STACK_NAME/config-download/$STACK_NAME/tripleo-ansible-inventory.yaml"
|
||||||
@ -224,11 +225,12 @@ EOF
|
|||||||
echo "Please review the file before running the next command - setup-mtu-t1"
|
echo "Please review the file before running the next command - setup-mtu-t1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if the stack exists
|
# Check if source inventory exists
|
||||||
function check_stack {
|
function check_source_inventory {
|
||||||
if [ ! -d $OOO_WORKDIR/$STACK_NAME/config-download/$STACK_NAME ]; then
|
local inventory_file="$OOO_WORKDIR/$STACK_NAME/config-download/$STACK_NAME/tripleo-ansible-inventory.yaml"
|
||||||
echo "ERROR: STACK_NAME=${STACK_NAME} does not exist. Please provide the stack name or its ID "
|
if [ ! -f $inventory_file ]; then
|
||||||
echo " via STACK_NAME environment variable."
|
echo "ERROR: Source Inventory File ${inventory_file} does not exist. Please provide the Stack Name and TripleO Workdir"
|
||||||
|
echo " via STACK_NAME and OOO_WORKDIR environment variables."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -352,7 +354,7 @@ command=$1
|
|||||||
ret_val=0
|
ret_val=0
|
||||||
case $command in
|
case $command in
|
||||||
generate-inventory)
|
generate-inventory)
|
||||||
check_stack
|
check_source_inventory
|
||||||
oc_check_public_network
|
oc_check_public_network
|
||||||
generate_ansible_inventory_file
|
generate_ansible_inventory_file
|
||||||
generate_ansible_config_file
|
generate_ansible_config_file
|
||||||
|
Loading…
Reference in New Issue
Block a user