Skip to content
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

core: capture exceptions caused by unregistered provider and auto-register it #3045

Merged
merged 10 commits into from
May 1, 2017

Conversation

yugangw-msft
Copy link
Contributor

General Guidelines

  • The PR has modified HISTORY.rst with an appropriate description of the change (see Modifying change log).

Command Guidelines

  • Each command and parameter has a meaningful description.
  • Each new command has a test.

(see Authoring Command Modules)

"Run 'az provider register -n {}' to register the namespace first".format(
match.group(1)))
elif pertinent_text_feature in msg:
reg = r".*{}\s+([^\s]+)\s+".format(pertinent_text_feature)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feature is much less used and sniffing the text is a bit tricky i like to avoid, so i am removing the polish rather focus on the provider error, which end customers do hit.

@codecov-io
Copy link

codecov-io commented Apr 27, 2017

Codecov Report

Merging #3045 into master will increase coverage by 0.05%.
The diff coverage is 89.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3045      +/-   ##
==========================================
+ Coverage   70.42%   70.47%   +0.05%     
==========================================
  Files         360      360              
  Lines       23185    23204      +19     
  Branches     3555     3558       +3     
==========================================
+ Hits        16329    16354      +25     
+ Misses       5822     5817       -5     
+ Partials     1034     1033       -1
Impacted Files Coverage Δ
...urce/azure/cli/command_modules/resource/_params.py 100% <100%> (ø) ⬆️
...azure-cli-core/azure/cli/core/commands/__init__.py 85.51% <100%> (+3.64%) ⬆️
...ource/azure/cli/command_modules/resource/custom.py 49.82% <66.66%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce8b827...5c857c9. Read the comment docs.

from azure.cli.core.commands import _check_rp_not_registered_err


# pylint: disable=line-too-long
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only line requires this is line 34, can you put it there? Additionally, that line itself can be broken into multiple lines.

@troydai
Copy link
Contributor

troydai commented Apr 28, 2017

Fix CI first, of course.

@yugangw-msft yugangw-msft requested a review from vivsriaus April 28, 2017 19:29
@@ -2,6 +2,8 @@

Release History
===============
2.0.4 (Unreleased)
*core: capture exceptions caused by unregistered provider and auto-register it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you add a heading ^^^^^? Also, need a space after *.

time.sleep(10)
rp_info = rcf.providers.get(rp)
if rp_info.registration_state == 'Registered':
logger.warning("Registeration succeeded.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo 'Registeration'

@yugangw-msft yugangw-msft force-pushed the rp-reg branch 3 times, most recently from 00a9be0 to 5141351 Compare May 1, 2017 17:02
@troydai
Copy link
Contributor

troydai commented May 1, 2017

Ping @derekbekoe @vivsriaus

@yugangw-msft yugangw-msft merged commit ef0fa90 into Azure:master May 1, 2017
@yugangw-msft yugangw-msft deleted the rp-reg branch May 1, 2017 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants