Skip to content

Commit f7eea01

Browse files
committed
Formatting errors resolution
Formatting errors mentioned in #1554 being resolved.
1 parent f266dcc commit f7eea01

File tree

6 files changed

+55
-26
lines changed

6 files changed

+55
-26
lines changed

SoftLayer/CLI/block/snapshot/get_notify_status.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ def cli(env, volume_id):
1616
block_manager = SoftLayer.BlockStorageManager(env.client)
1717
enabled = block_manager.get_block_snapshots_notification_status(volume_id)
1818

19-
2019
if (enabled == ''):
21-
click.echo('Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
20+
click.echo(
21+
'Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
2222
% (volume_id))
2323
elif (enabled == 'True'):
24-
click.echo('Snapshots space usage threshold warning flag setting is enabled for volume %s'
24+
click.echo(
25+
'Snapshots space usage threshold warning flag setting is enabled for volume %s'
2526
% (volume_id))
2627
else:
27-
click.echo('Snapshots space usage threshold warning flag setting is disabled for volume %s'
28-
% (volume_id))
28+
click.echo(
29+
'Snapshots space usage threshold warning flag setting is disabled for volume %s'
30+
% (volume_id))

SoftLayer/CLI/block/snapshot/set_notify_status.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99

1010
@click.command()
1111
@click.argument('volume_id')
12-
@click.option('--notification_flag',
13-
help='Enable / disable sending sending notifications for snapshots space usage threshold warning [True|False]',
14-
required=True)
12+
@click.option(
13+
'--notification_flag',
14+
help=
15+
'Enable / disable sending sending notifications for snapshots space usage threshold warning [True|False]',
16+
required=True)
1517
@environment.pass_env
1618
def cli(env, volume_id, notification_flag):
1719
"""Enables/Disables snapshot space usage threshold warning for a given volume"""
1820
if (notification_flag not in ['True', 'False']):
19-
raise exceptions.CLIAbort(
20-
'--notification-flag must be True or False')
21+
raise exceptions.CLIAbort('--notification-flag must be True or False')
2122

2223
block_manager = SoftLayer.BlockStorageManager(env.client)
23-
disabled = block_manager.set_block_volume_snapshot_notification(volume_id, notification_flag)
24+
disabled = block_manager.set_block_volume_snapshot_notification(
25+
volume_id, notification_flag)
2426

2527
if disabled:
26-
click.echo('Snapshots space usage threshold warning notification has bee set to %s for volume %s'
27-
% (notification-flag, volume_id))
28+
click.echo(
29+
'Snapshots space usage threshold warning notification has bee set to %s for volume %s'
30+
% (notification - flag, volume_id))

SoftLayer/CLI/file/snapshot/get_notify_status.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ def cli(env, volume_id):
1717
enabled = file_manager.get_file_snapshots_notification_status(volume_id)
1818

1919
if (enabled == ''):
20-
click.echo('Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
20+
click.echo(
21+
'Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
2122
% (volume_id))
2223
elif (enabled == 'True'):
23-
click.echo('Snapshots space usage threshold warning flag setting is enabled for volume %s'
24+
click.echo(
25+
'Snapshots space usage threshold warning flag setting is enabled for volume %s'
2426
% (volume_id))
2527
else:
26-
click.echo('Snapshots space usage threshold warning flag setting is disabled for volume %s'
27-
% (volume_id))
28+
click.echo(
29+
'Snapshots space usage threshold warning flag setting is disabled for volume %s'
30+
% (volume_id))

SoftLayer/CLI/file/snapshot/set_notify_status.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@
99

1010
@click.command()
1111
@click.argument('volume_id')
12-
@click.option('--notification_flag',
13-
help='Enable / disable sending sending notifications for snapshots space usage threshold warning [True|False]',
14-
required=True)
12+
@click.option(
13+
'--notification_flag',
14+
help=
15+
'Enable / disable sending sending notifications for snapshots space usage threshold warning [True|False]',
16+
required=True)
1517
@environment.pass_env
1618
def cli(env, volume_id, notification_flag):
1719
"""Enables/Disables snapshot space usage threshold warning for a given volume"""
1820

1921
if (notification_flag not in ['True', 'False']):
20-
raise exceptions.CLIAbort(
21-
'--notification-flag must be True or False')
22+
raise exceptions.CLIAbort('--notification-flag must be True or False')
2223

2324
file_manager = SoftLayer.FileStorageManager(env.client)
24-
disabled = file_manager.set_file_volume_snapshot_notification(volume_id, notification_flag)
25+
disabled = file_manager.set_file_volume_snapshot_notification(
26+
volume_id, notification_flag)
2527

2628
if disabled:
27-
click.echo('Snapshots space usage threshold warning notification has bee set to %s for volume %s'
28-
% (notification-flag, volume_id))
29+
click.echo(
30+
'Snapshots space usage threshold warning notification has bee set to %s for volume %s'
31+
% (notification - flag, volume_id))

docs/cli/block.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,12 @@ Block Commands
146146
.. click:: SoftLayer.CLI.block.replication.disaster_recovery_failover:cli
147147
:prog: block disaster-recovery-failover
148148
:show-nested:
149+
150+
151+
.. click:: SoftLayer.CLI.block.snapshot.set_notify_status:cli
152+
:prog: block snapshot-set-notification
153+
:show-nested:
154+
155+
.. click:: SoftLayer.CLI.block.snapshot.get_notify_status:cli
156+
:prog: block snapshot-get-notification
157+
:show-nested:

docs/cli/file.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,13 @@ File Commands
125125

126126
.. click:: SoftLayer.CLI.file.replication.disaster_recovery_failover:cli
127127
:prog: file disaster-recovery-failover
128-
:show-nested:
128+
:show-nested:
129+
130+
.. click:: SoftLayer.CLI.file.snapshot.set_notify_status:cli
131+
:prog: file snapshot-set-notification
132+
:show-nested:
133+
134+
.. click:: SoftLayer.CLI.file.snapshot.get_notify_status:cli
135+
:prog: file snapshot-get-notification
136+
:show-nested:
137+

0 commit comments

Comments
 (0)