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

{Pylint} Fix no-else-break #18000

Merged
merged 1 commit into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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 @@ -195,31 +195,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 @@ -236,13 +236,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