Skip to content

Commit

Permalink
{Pylint} Fix no-else-break (#18000)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasli authored May 13, 2021
1 parent 48cc5e5 commit 3f230e8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
1 change: 0 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ disable=
locally-disabled,
missing-docstring,
missing-kwoa,
no-else-break,
no-else-continue,
no-member,
no-value-for-parameter,
Expand Down
7 changes: 3 additions & 4 deletions src/azure-cli-core/azure/cli/core/commands/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def _find_split():
# keys done the rest is value
value = chars
break
elif c == '[':
if c == '[':
brackets = True
key += c
elif c == ']' and brackets:
Expand Down Expand Up @@ -728,13 +728,12 @@ def assign_identity(cli_ctx, getter, setter, identity_role=None, identity_scope=
if 'role assignment already exists' in ex.message:
logger.info('Role assignment already exists')
break
elif retry_time < retry_times and ' does not exist in the directory ' in ex.message:
if retry_time < retry_times and ' does not exist in the directory ' in ex.message:
time.sleep(5)
logger.warning('Retrying role assignment creation: %s/%s', retry_time + 1,
retry_times)
continue
else:
raise
raise
return resource


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_lang_from_content(src_path, html=False):
fnmatch.fnmatch(file, "*shtml.")):
static_html_file = os.path.join(src_path, file)
break
elif fnmatch.fnmatch(file, "*.csproj"):
if fnmatch.fnmatch(file, "*.csproj"):
package_netcore_file = os.path.join(src_path, file)
break

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def remove_rule(client, resource_group_name, profile_name, endpoint_name, rule_n
if rule_name is not None and rule.name == rule_name:
pop_index = idx
break
elif order is not None and rule.order == order:
if order is not None and rule.order == order:
pop_index = idx
break

Expand Down
22 changes: 11 additions & 11 deletions src/azure-cli/azure/cli/command_modules/resource/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,31 +196,31 @@ def _prompt_for_parameters(missing_parameters, fail_on_no_tty=True): # pylint:
result[param_name] = None
no_tty = True
break
elif param_type == 'securestring':
if param_type == 'securestring':
try:
value = prompt_pass(prompt_str, help_string=description)
except NoTTYException:
value = None
no_tty = True
result[param_name] = value
break
elif param_type == 'int':
if param_type == 'int':
try:
int_value = prompt_int(prompt_str, help_string=description)
result[param_name] = int_value
except NoTTYException:
result[param_name] = 0
no_tty = True
break
elif param_type == 'bool':
if param_type == 'bool':
try:
value = prompt_t_f(prompt_str, help_string=description)
result[param_name] = value
except NoTTYException:
result[param_name] = False
no_tty = True
break
elif param_type in ['object', 'array']:
if param_type in ['object', 'array']:
try:
value = prompt(prompt_str, help_string=description)
except NoTTYException:
Expand All @@ -237,13 +237,13 @@ def _prompt_for_parameters(missing_parameters, fail_on_no_tty=True): # pylint:
continue
result[param_name] = value
break
else:
try:
result[param_name] = prompt(prompt_str, help_string=description)
except NoTTYException:
result[param_name] = None
no_tty = True
break

try:
result[param_name] = prompt(prompt_str, help_string=description)
except NoTTYException:
result[param_name] = None
no_tty = True
break
if no_tty and fail_on_no_tty:
raise NoTTYException
return result
Expand Down

0 comments on commit 3f230e8

Please sign in to comment.