Skip to content

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

Closed
syed wants to merge 2 commits intoapache:trunkfrom
syed:trunk
Closed

Handle case where Cloudstack can return Unlimited instead of int#512
syed wants to merge 2 commits intoapache:trunkfrom
syed:trunk

Conversation

@syed
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants