Skip to content

Commit 4ccb9b8

Browse files
committed
Incorporating review comments
1 parent da4593e commit 4ccb9b8

File tree

6 files changed

+12
-57
lines changed

6 files changed

+12
-57
lines changed

SoftLayer/CLI/block/snapshot/get_notify_status.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ def cli(env, volume_id):
1414
"""Get snapshots space usage threshold warning flag setting for a given volume"""
1515

1616
block_manager = SoftLayer.BlockStorageManager(env.client)
17-
enabled = block_manager.get_block_snapshots_notification_status(volume_id)
17+
enabled = block_manager.get_volume_snapshot_notification_status(volume_id)
1818

1919
if (enabled == ''):
2020
click.echo(
21-
'Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
21+
'Enabled:Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
2222
% (volume_id))
2323
elif (enabled == 'True'):
2424
click.echo(
25-
'Snapshots space usage threshold warning flag setting is enabled for volume %s'
25+
'Enabled:Snapshots space usage threshold warning flag setting is enabled for volume %s'
2626
% (volume_id))
2727
else:
2828
click.echo(
29-
'Snapshots space usage threshold warning flag setting is disabled for volume %s'
29+
'Disabled:Snapshots space usage threshold warning flag setting is disabled for volume %s'
3030
% (volume_id))

SoftLayer/CLI/block/snapshot/set_notify_status.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ def cli(env, volume_id, enable):
1818
"""Enables/Disables snapshot space usage threshold warning for a given volume"""
1919
block_manager = SoftLayer.BlockStorageManager(env.client)
2020

21-
if enable:
22-
enabled = 'True'
23-
else:
24-
enabled = 'False'
25-
status = block_manager.set_block_volume_snapshot_notification(
26-
volume_id, enabled)
21+
status = block_manager.set_volume_snapshot_notification(
22+
volume_id, enable)
2723

2824
if status:
2925
click.echo(

SoftLayer/CLI/file/snapshot/get_notify_status.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ def cli(env, volume_id):
1414
"""Get snapshots space usage threshold warning flag setting for a given volume"""
1515

1616
file_manager = SoftLayer.FileStorageManager(env.client)
17-
enabled = file_manager.get_file_snapshots_notification_status(volume_id)
17+
enabled = file_manager.get_volume_snapshot_notification_status(volume_id)
1818

1919
if (enabled == ''):
2020
click.echo(
21-
'Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
21+
'Enabled:Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
2222
% (volume_id))
2323
elif (enabled == 'True'):
2424
click.echo(
25-
'Snapshots space usage threshold warning flag setting is enabled for volume %s'
25+
'Enabled:Snapshots space usage threshold warning flag setting is enabled for volume %s'
2626
% (volume_id))
2727
else:
2828
click.echo(
29-
'Snapshots space usage threshold warning flag setting is disabled for volume %s'
29+
'Disabled:Snapshots space usage threshold warning flag setting is disabled for volume %s'
3030
% (volume_id))

SoftLayer/CLI/file/snapshot/set_notify_status.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ def cli(env, volume_id, enable):
1818
"""Enables/Disables snapshot space usage threshold warning for a given volume"""
1919
file_manager = SoftLayer.FileStorageManager(env.client)
2020

21-
if enable:
22-
enabled = 'True'
23-
else:
24-
enabled = 'False'
25-
26-
status = file_manager.set_file_volume_snapshot_notification(
27-
volume_id, enabled)
21+
status = file_manager.set_volume_snapshot_notification(
22+
volume_id, enable)
2823
if status:
2924
click.echo(
3025
'Snapshots space usage threshold warning notification has bee set to %s for volume %s'

SoftLayer/managers/block.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,6 @@ def get_block_volume_snapshot_list(self, volume_id, **kwargs):
102102
"""
103103
return self.get_volume_snapshot_list(volume_id, **kwargs)
104104

105-
def set_block_volume_snapshot_notification(self, volume_id, notification_flag, **kwargs):
106-
"""Enables/Disables snapshot space usage threshold warning for a given volume.
107-
108-
:param volume_id: ID of volume.
109-
:param kwargs:
110-
:param notification-flag: Enable/Disable flag for snapshot warning notification.
111-
:return: Enables/Disables snapshot space usage threshold warning for a given volume.
112-
"""
113-
return self.client.call('Network_Storage', 'setSnapshotNotification', notification_flag, id=volume_id, **kwargs)
114-
115-
def get_block_snapshots_notification_status(self, volume_id, **kwargs):
116-
"""returns Enabled/Disabled snapshot space usage threshold warning for a given volume.
117-
118-
:param volume_id: ID of volume.
119-
:param kwargs:
120-
:return: Enabled/Disabled snapshot space usage threshold warning for a given volume.
121-
"""
122-
return self.client.call('Network_Storage', 'getSnapshotNotificationStatus', id=volume_id, **kwargs)
123-
124105
def assign_subnets_to_acl(self, access_id, subnet_ids):
125106
"""Assigns subnet records to ACL for the access host.
126107

SoftLayer/managers/file.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,7 @@ def get_file_volume_snapshot_list(self, volume_id, **kwargs):
129129
:return: Returns a list of snapshots for the specified volume.
130130
"""
131131
return self.get_volume_snapshot_list(volume_id, **kwargs)
132-
def set_file_volume_snapshot_notification(self, volume_id, notification_flag, **kwargs):
133-
"""Enables/Disables snapshot space usage threshold warning for a given volume.
134132

135-
:param volume_id: ID of volume.
136-
:param kwargs:
137-
:param notification-flag: Enable/Disable flag for snapshot warning notification.
138-
:return: Enables/Disables snapshot space usage threshold warning for a given volume.
139-
"""
140-
return self.client.call('Network_Storage', 'setSnapshotNotification', notification_flag, id=volume_id, **kwargs)
141-
142-
def get_file_snapshots_notification_status(self, volume_id, **kwargs):
143-
"""returns Enabled/Disabled snapshot space usage threshold warning for a given volume.
144-
145-
:param volume_id: ID of volume.
146-
:param kwargs:
147-
:return: Enabled/Disabled snapshot space usage threshold warning for a given volume.
148-
"""
149-
return self.client.call('Network_Storage', 'getSnapshotNotificationStatus', id=volume_id, **kwargs)
150133
def order_file_volume(self, storage_type, location, size,
151134
iops=None, tier_level=None, snapshot_size=None,
152135
service_offering='storage_as_a_service',

0 commit comments

Comments
 (0)