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
base: trunk
from

Conversation

Projects
None yet
2 participants
@syed
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@syed

syed May 12, 2015

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami May 16, 2015

Member

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.

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