Skip to content

Commit 6ce7991

Browse files
Merge pull request softlayer#2145 from allmightyspiff/issues2144
Fixed an issue with confirmation not handling uppercase ids
2 parents 14b75d4 + 78e3abf commit 6ce7991

File tree

5 files changed

+59
-157
lines changed

5 files changed

+59
-157
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the default behavior, in case people don't have core.autocrlf set.
22
* text=auto
3+
*.* text eol=lf
34

45
# Language aware diff headers
56
# https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more

SoftLayer/CLI/file/cancel.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
1313
@click.argument('volume-id')
1414
@click.option('--reason', help="An optional reason for cancellation")
15-
@click.option('--immediate',
16-
is_flag=True,
17-
help="Cancels the file storage volume immediately instead "
18-
"of on the billing anniversary")
15+
@click.option('--immediate', is_flag=True,
16+
help="Cancels the file storage volume immediately instead of on the billing anniversary")
1917
@click.option('--force', default=False, is_flag=True, help="Force modify")
2018
@environment.pass_env
2119
def cli(env, volume_id, reason, immediate, force):
@@ -32,15 +30,12 @@ def cli(env, volume_id, reason, immediate, force):
3230
if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
3331
raise exceptions.CLIAbort('Aborted.')
3432

35-
cancelled = file_storage_manager.cancel_file_volume(volume_id,
36-
reason, immediate)
33+
cancelled = file_storage_manager.cancel_file_volume(volume_id, reason, immediate)
3734

3835
if cancelled:
3936
if immediate:
40-
click.echo('File volume with id %s has been marked'
41-
' for immediate cancellation' % volume_id)
37+
click.echo(f'File volume with id {volume_id} has been marked for immediate cancellation')
4238
else:
43-
click.echo('File volume with id %s has been marked'
44-
' for cancellation' % volume_id)
39+
click.echo(f'File volume with id {volume_id} has been marked for cancellation')
4540
else:
46-
click.echo('Unable to cancle file volume %s' % volume_id)
41+
click.echo(f'Unable to cancle file volume {volume_id}')

SoftLayer/CLI/formatting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def no_going_back(confirmation):
262262
prompt = f"This action cannot be undone! Type '{confirmation}' or press Enter to abort"
263263

264264
ans = click.prompt(prompt, default='', show_default=False)
265-
if ans.lower() == str(confirmation):
265+
if ans.lower() == str(confirmation).lower():
266266
return True
267267

268268
return False

0 commit comments

Comments
 (0)