Bug 1397202

Summary: Tripleo breakpoints RegExp are not properly documented
Product: Red Hat OpenStack Reporter: David Hill <dhill>
Component: documentationAssignee: Dan Macpherson <dmacpher>
Status: CLOSED CURRENTRELEASE QA Contact: RHOS Documentation Team <rhos-docs>
Severity: low Docs Contact:
Priority: low    
Version: 8.0 (Liberty)CC: dhill, dmacpher, hbrock, ipetrova, jslagle, mburns, rcernin, rhel-osp-director-maint, srevivo
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-19 15:14:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Hill 2016-11-21 21:52:52 UTC
Description of problem:
Tripleo breakpoints RegExp are not properly documented in our documentation [1].  Some samples could be provided or an info box could be added in order to point the user in the python regular expressions formats.

[1] https://access.redhat.com/documentation/en/red-hat-openstack-platform/8/single/upgrading-red-hat-openstack-platform/#sect-Updating_the_Overcloud

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


How reproducible:
Always


Steps to Reproduce:
1. Try to use shell regular expressions and it fails
2.
3.

Actual results:
Fails

Expected results:
Succeeds 

Additional info:

Comment 1 Dan Macpherson 2016-12-09 06:16:49 UTC
Hi David,

Thanks for reporting this. This is an excellent idea.

My assumption was the standard regexp patterns apply but it seems this isn't the case. Did you have any suggestions for valid regexps?

Comment 2 Robin Cernin 2017-01-03 13:43:24 UTC
Enter 'Regexp' or 'Quit': overcloud-comp-0*
Enter hosts file: 
Enter 'Regexp' or 'Quit': overcloud-comp-0[1-9]
Enter hosts file: 
overcloud-comp-01
overcloud-comp-02
overcloud-comp-03
overcloud-comp-04
Enter 'Regexp' or 'Quit': 

This script uses the same regexp as the deployment and you could test this prior to update to make sure you match your hostnames:

----8<----

#!/usr/bin/env python
# encoding=utf-8 (pep 0263)

import re

while True:
    regexp = input("Enter 'Regexp' or 'Quit': ")
    if regexp == "Quit": break
    file = input("Enter hosts file: ")
    if (len(file) < 1): file = 'hosts.txt'
    fh = open(file)
    try:
        for line in fh:
            line = line.rstrip()
            pattern = "\A{0}\Z".format(regexp)
            if re.match(pattern, line):
                print(line)
    except re.error as err:
        print("'%s' is invalid regular expression: %s", regexp.encode('string-escape'), err)

----8<----

Comment 3 Irina Petrova 2017-01-11 10:51:59 UTC
(In reply to Dan Macpherson from comment #1)
> Hi David,
> 
> Thanks for reporting this. This is an excellent idea.
> 
> My assumption was the standard regexp patterns apply but it seems this isn't
> the case. Did you have any suggestions for valid regexps?

Hi Dan,

Thank you for asking but that won't actually be needed.

It seems that there was a communication gap between us and the customer: he clarifies in a recent update that the confusing part for him was not the format of the regex but the type itself, i.e. that it is 'python regex' that is expected (vs shell regex, globbing, perl syntax, etc).

He is also suggesting those two links as a potential candidate for receiving a small brush-up/note about it:

https://access.redhat.com/documentation/en/red-hat-openstack-platform/8/single/upgrading-red-hat-openstack-platform/#sect-Updating_the_Overcloud

https://access.redhat.com/documentation/en/red-hat-openstack-platform/8/single/command-line-interface-reference/#openstackclient_subcommand_overcloud_update_stack

Please feel free to edit as you find most suitable one or both of the aforementioned documents.

Ping back if anything. :}

Regards,
Irina

Comment 4 Dan Macpherson 2017-01-18 02:46:48 UTC
Ah, awesome. I'll add that the regexp patterns need to be python-based.

Comment 5 Irina Petrova 2017-01-18 08:57:26 UTC
Great! Thanks, Dan. :)

Comment 6 Dan Macpherson 2017-01-19 01:52:26 UTC
Have include a note that the regexs are to be Python-based:

https://access.redhat.com/documentation/en/red-hat-openstack-platform/8/single/upgrading-red-hat-openstack-platform/#sect-Updating_the_Overcloud

Have also included this same note on OSP9 and OSP10 docs.

Irina, anything further required for this BZ?

Comment 7 Irina Petrova 2017-01-19 08:43:27 UTC
Hey Dan,

I think it's good. Let me ask the customer who raised the question if there's anything else that he finds confusing.

--Irina

Comment 8 Irina Petrova 2017-01-19 12:38:05 UTC
Hi Dan,

Nothing to add from the customer. We're good to go.

Many thanks!

--Irina

Comment 9 Dan Macpherson 2017-01-19 15:14:57 UTC
Excellent. Closing this BZ.