Bug 2070683 - Output file /home/stack/templates/overcloud-baremetal-deployed.yaml already exists
Summary: Output file /home/stack/templates/overcloud-baremetal-deployed.yaml already e...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Harald Jensås
QA Contact: David Rosenfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-31 16:34 UTC by Jason Paroly
Modified: 2022-09-21 12:20 UTC (History)
6 users (show)

Fixed In Version: python-tripleoclient-16.4.1-0.20220407001042.0021766.el9ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 12:20:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 833850 0 None MERGED Add --yes to overcloud node provision for output file overwrite 2022-04-04 06:15:19 UTC
Red Hat Issue Tracker OSP-14424 0 None None None 2022-03-31 16:36:01 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:20:34 UTC

Description Jason Paroly 2022-03-31 16:34:21 UTC
Description of problem:
CI job failing due to file already existing during openstack overcloude node provision command

Version-Release number of selected component (if applicable):


How reproducible:
saw once so far

Steps to Reproduce:
1. on installed undercloud run command:
openstack overcloud node provision --stack overcloud --network-config \
            --output /home/stack/templates/overcloud-baremetal-deployed.yaml \
            /home/stack/virt/network/baremetal_deployment.yaml
2.
3.

Actual results:
error that output file already exists
FATAL | fail | localhost | error={"changed": false, "msg": "Output file /home/stack/templates/overcloud-baremetal-deployed.yaml already exists"}


Expected results:
command succeeds

Additional info:

Command:

Comment 2 Harald Jensås 2022-04-01 09:52:16 UTC
The 'openstack overcloud node provision' command does a check if the file exists and prompts the user for confirmation that the file can be overwritten.
In automation the prompt leads to failure, since there is no human to answer 'yes'.

You can add the '--yes' option to 'openstack overcloud node provision' command to make it overwrite the file without asking.

Alternatively add a step to clean up the file in CI, if we have jobs that provision -> unprovision -> provision it makes sense to clean up this file as part of the unprovision step.

Comment 3 Jason Paroly 2022-04-01 13:07:15 UTC
Strange that this did not occur when testing in staging.  I will add the '--yes' though and see how it goes.  Thank you Harald!

Comment 4 Jason Paroly 2022-04-01 17:51:24 UTC
Using '--yes' did not work.

I tried to place the '--yes' in several places in the command and always get this:

usage: openstack overcloud node provision [-h] [-o OUTPUT] [--stack STACK]
                                          [--overcloud-ssh-user OVERCLOUD_SSH_USER]
                                          [--overcloud-ssh-key OVERCLOUD_SSH_KEY]
                                          [--concurrency CONCURRENCY]
                                          [--timeout TIMEOUT]
                                          [--network-ports] [--network-config]
                                          [--templates TEMPLATES]
                                          [--working-dir WORKING_DIR]
                                          <baremetal_deployment.yaml>
openstack overcloud node provision: error: unrecognized arguments: --yes

Comment 6 Harald Jensås 2022-04-04 06:14:27 UTC
Ok, I found the issue. The '--yes' option was added recently, 1 month ago.
This is the commit in `rhos-17.0-trunk-patches`:

commit 57bcf3b2e3aab8d82fb4c8ec35684a7a0546078c
Author: James Slagle <jslagle>
Date:   Wed Feb 23 15:11:01 2022 -0500

    Add --yes to overcloud node provision for output file overwrite
    
    Previously, the command did not check if the output file already
    existed. A check is now added, which can be bypassed with the added
    --yes argument.
    
    Depends-On: I28f0b6399ced8c185c04e2e6a7dd7906e2eaadd4
    Change-Id: Ic8c6b37c23bc6df1007f7a3a68cac5ef71a9918e
    Signed-off-by: James Slagle <jslagle>
    (cherry picked from commit 34b4d6bfcb1e1d06f01a1842ea971b56c8fa64f5)


The patch is not in python3-tripleoclient-16.4.1-0.20220317201057.b7b58c4.el8ost.noarch.

I think we need to wait for the next puddle. (Or add a step in the job to clean up the existing file.)

Comment 11 errata-xmlrpc 2022-09-21 12:20:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543


Note You need to log in before you can comment on or make changes to this bug.