Skip to content

Commit

Permalink
webapp/functionapp: capture the error when plan can be None (Azure#5919)
Browse files Browse the repository at this point in the history
  • Loading branch information
yugangw-msft authored Mar 27, 2018
1 parent 40741cd commit 55f9aca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/command_modules/azure-cli-appservice/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
Release History
===============
0.1.31
++++++
* webapp: capture the unhandled exception if the appservice plan doesn't exist

0.1.30
++++++
* webapp: az webapp update supports httpsOnly
* webapp/functionapp: slot support for identity assign & identity show=======
* webapp/functionapp: slot support for identity assign & identity show

0.1.29
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def create_webapp(cmd, resource_group_name, name, plan, runtime=None, startup_fi
plan_info = client.app_service_plans.get(parse_result['resource_group'], parse_result['name'])
else:
plan_info = client.app_service_plans.get(resource_group_name, plan)
if not plan_info:
raise CLIError("The plan '{}' doesn't exist".format(plan))
is_linux = plan_info.reserved
node_default_version = "6.9.1"
location = plan_info.location
Expand Down Expand Up @@ -1520,6 +1522,7 @@ def create_function(cmd, resource_group_name, name, storage_account, plan=None,
consumption_plan_location=None, deployment_source_url=None,
deployment_source_branch='master', deployment_local_git=None,
deployment_container_image_name=None):
# pylint: disable=too-many-statements
if deployment_source_url and deployment_local_git:
raise CLIError('usage error: --deployment-source-url <url> | --deployment-local-git')
if bool(plan) == bool(consumption_plan_location):
Expand All @@ -1540,6 +1543,8 @@ def create_function(cmd, resource_group_name, name, storage_account, plan=None,
if is_valid_resource_id(plan):
plan = parse_resource_id(plan)['name']
plan_info = client.app_service_plans.get(resource_group_name, plan)
if not plan_info:
raise CLIError("The plan '{}' doesn't exist".format(plan))
location = plan_info.location
is_linux = plan_info.reserved
if is_linux:
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-appservice/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "0.1.30"
VERSION = "0.1.31"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 55f9aca

Please sign in to comment.