@@ -19,11 +19,16 @@ class StorageManager(utils.IdentifierMixin, object):
1919
2020 :param SoftLayer.API.BaseClient client: the client instance
2121 """
22+
2223 def __init__ (self , client ):
2324 self .configuration = {}
2425 self .client = client
2526 self .resolvers = [self ._get_ids_from_username ]
2627
28+ def _get_ids_from_username (self , username ): # pylint: disable=unused-argument,no-self-use
29+ """Should only be actually called from the block/file manager"""
30+ return []
31+
2732 def get_volume_count_limits (self ):
2833 """Returns a list of block volume count limit.
2934
@@ -122,20 +127,21 @@ def set_volume_snapshot_notification(self, volume_id, enable):
122127 :return: Enables/Disables snapshot space usage threshold warning for a given volume.
123128 """
124129
125- return self .client .call ('Network_Storage' ,
126- 'setSnapshotNotification' ,
127- enable ,
128- id = volume_id )
130+ return self .client .call ('Network_Storage' , 'setSnapshotNotification' , enable , id = volume_id )
129131
130132 def get_volume_snapshot_notification_status (self , volume_id ):
131133 """returns Enabled/Disabled status of snapshot space usage threshold warning for a given volume.
132134
133135 :param volume_id: ID of volume.
134136 :return: Enables/Disables snapshot space usage threshold warning for a given volume.
135137 """
136- return self .client .call ('Network_Storage' ,
137- 'getSnapshotNotificationStatus' ,
138- id = volume_id )
138+ status = self .client .call ('Network_Storage' , 'getSnapshotNotificationStatus' , id = volume_id )
139+ # A None status is enabled as well.
140+ if status is None :
141+ status = 1
142+ # We need to force int on the return because otherwise the API will return the string '0'
143+ # instead of either a boolean or real int...
144+ return int (status )
139145
140146 def authorize_host_to_volume (self ,
141147 volume_id ,
0 commit comments