Skip to content

Conversation

houstar
Copy link

@houstar houstar commented Aug 3, 2017

Signed-off-by: Leno Hou houqy@linux.vnet.ibm.com

Copy link
Member

@allmightyspiff allmightyspiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://sldn.softlayer.com/reference/datatypes/SoftLayer_Network_Storage has the "provisionedIops" property, which I would recommend using here instead of the properties. This way you can make the same change to file and block storage details and it should work for both.

@allmightyspiff
Copy link
Member

Also, update the unit tests so they pass Travis CI. You can likely just change the test to not check for the mask as I don't think thats a very good test.

@houstar
Copy link
Author

houstar commented Aug 4, 2017

@allmightyspiff Could you help me to skip the mask check ?

@allmightyspiff
Copy link
Member

The current test is

tests/managers/block_tests.py

    def test_get_block_volume_details(self):
        result = self.block.get_block_volume_details(100)

        self.assertEqual(fixtures.SoftLayer_Network_Storage.getObject, result)

        expected_mask = 'id,'\
                        'username,'\
                        'password,'\
                        'capacityGb,'\
                        'snapshotCapacityGb,'\
                        'parentVolume.snapshotSizeBytes,'\
                        'storageType.keyName,'\
                        'serviceResource.datacenter[name],'\
                        'serviceResourceBackendIpAddress,'\
                        'storageTierLevel,'\
                        'iops,'\
                        'lunId,'\
                        'originalVolumeName,'\
                        'originalSnapshotName,'\
                        'originalVolumeSize,'\
                        'activeTransactionCount,'\
                        'activeTransactions.transactionStatus[friendlyName],'\
                        'replicationPartnerCount,'\
                        'replicationStatus,'\
                        'replicationPartners[id,username,'\
                        'serviceResourceBackendIpAddress,'\
                        'serviceResource[datacenter[name]],'\
                        'replicationSchedule[type[keyname]]]'

        self.assert_called_with(
            'SoftLayer_Network_Storage',
            'getObject',
            identifier=100,
            mask='mask[%s]' % expected_mask
            )

I'd either update the mask to match what you changed it to, or just remove the mask along with the "mask='mask[%s]' % expected_mask" bit on self.assert_called_with.

To test locally, you can use "tox" to run the test suite to make sure it all works.

v1 -> v2:
  1. use provisionedIops instead of properties.
  2. updated mask accordingly.

Signed-off-by: Leno Hou <houqy@linux.vnet.ibm.com>
@allmightyspiff
Copy link
Member

I'm going to address this in #912

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants