Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case where Cloudstack can return Unlimited instead of int #512

Closed
wants to merge 2 commits into from

Conversation

syed
Copy link
Contributor

@syed syed commented May 7, 2015

Sometimes the Cloudstack API returns 'Unlimited' instead of an int. For instance, this is a sample output of listProjects()

{
    'primarystorageavailable': 'Unlimited',
    'domain': 'demo',
    'domainid': '6ee35be2-8002-46a3-8736-b071aa059fd6',
    'vpclimit': 'Unlimited',
    'iplimit': 'Unlimited',
    'volumelimit': 'Unlimited',
    'memorytotal': 14336,
    'secondarystorageavailable': 'Unlimited',
    'vmtotal': 7,
    'displaytext': 'DefaultEnv.',
    'vpctotal': 1,
    'id': '7862b2ed-5204-45e4-b036-b2237db40cde',
    'cpuavailable': 'Unlimited',
    'networklimit': 'Unlimited',
    'iptotal': 2,
    'volumetotal': 14,
    'snapshotlimit': 'Unlimited'....
}

This change uses a transform function to check for the Unlimited case . I am using -1 to mean unlimited.

@syed
Copy link
Contributor Author

syed commented May 12, 2015

Hi,
Any update on this PR? I don't know why it failed on Travis, it works fine for me.

@asfgit asfgit closed this in 2c8b1ee May 16, 2015
@Kami
Copy link
Member

Kami commented May 16, 2015

Fixed lint (9f21f1f) and Python 2.5 version compatibility issue (635c34e), added a test case (635c34e) and merged change into trunk.

The lint issue was related to lines being longer than 80 characters.

Thanks.

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.

None yet

2 participants