Skip to content

Changing python regex method from match to search #7484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2018

Conversation

ewolinetz
Copy link
Contributor

Changing due to variable content structure
new_file_contents is structured in such a way that we need to search anywhere in the string.

>>> for curr_line in current_contents.split("\n"):
...     print curr_line
... 
index: 
  number_of_shards: 2
  number_of_replicas: 1
bogusness: true

>>> for line in white_list:
...     regex_line = r".+" + re.escape(line) + r":.*\n"
...     new_line_file = re.match(regex_line, current_contents)
...     if new_line_file:
...         print new_line_file.group(0)
...     else:
...         print ""
... 




>>> for line in white_list:
...     regex_line = r".*" + re.escape(line) + r":.*\n"
...     new_line_file = re.search(regex_line, current_contents)
...     if new_line_file:
...         print new_line_file.group(0)
...     else:
...         print ""
... 
  number_of_shards: 2

  number_of_replicas: 1

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 10, 2018
@openshift-ci-robot
Copy link

@ewolinetz: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/gcp ffab9ca link /test gcp
ci/openshift-jenkins/system-containers ffab9ca link /test system-containers
ci/openshift-jenkins/extended_conformance_install_crio ffab9ca link /test crio
ci/openshift-jenkins/install ffab9ca link /test install
ci/openshift-jenkins/containerized ffab9ca link /test containerized
ci/openshift-jenkins/logging ffab9ca link /test logging

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ewolinetz
Copy link
Contributor Author

Tested and verified locally on 3.7 and 3.9 clusters

@ewolinetz ewolinetz requested review from jcantrill and sdodson March 10, 2018 19:55
@sdodson
Copy link
Member

sdodson commented Mar 10, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2018
@sdodson sdodson merged commit 606b9ec into openshift:release-3.9 Mar 10, 2018
@sdodson
Copy link
Member

sdodson commented Mar 10, 2018

/cherrypick master

@openshift-cherrypick-robot

@sdodson: new pull request created: #7485

In response to this:

/cherrypick master

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openshift-merge-robot added a commit that referenced this pull request Mar 11, 2018
…7484-to-master

Automatic merge from submit-queue.

[master] Changing python regex method from match to search

This is an automated cherry-pick of #7484

/assign sdodson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants