NG Launch Instance fails unlimited instance quota

Bug #1492265 reported by Matt Borland
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
In Progress
Undecided
Matt Borland

Bug Description

The Angular Launch Instance wizard fails to operate if the instance quota is unlimited (set to -1).

This is largely due to logic that assumes a value greater than zero.

Revision history for this message
Matt Borland (palecrow) wrote :

The current problem is that JSON.parse() doesn't recognize Infinity as a value:

(in nodejs, if I assign the JSON returned from the server, it replies with maxTotalInstances of Infinity which then causes a JSON parsing error)

> a = '{"maxImageMeta": 128, "maxPersonality": 5, "maxPersonalitySize": 10240, "maxSecurityGroupRules": 20, "maxSecurityGroups": 10, "maxServerGroupMembers": 10, "maxServerGroups": 10, "maxServerMeta": 128, "maxTotalCores": 20, "maxTotalFloatingIps": 10, "maxTotalInstances": Infinity, "maxTotalKeypairs": 100, "maxTotalRAMSize": 51200, "totalCoresUsed": 0, "totalFloatingIpsUsed": 0, "totalInstancesUsed": 0, "totalRAMUsed": 0, "totalSecurityGroupsUsed": 0, "totalServerGroupsUsed": 0}'

> JSON.parse(a)
SyntaxError: Unexpected token I
    at Object.parse (native)
    at repl:1:7
    at REPLServer.eval (repl.js:80:21)
    at Interface.<anonymous> (repl.js:182:12)
    at Interface.emit (events.js:67:17)
    at Interface._onLine (readline.js:162:10)
    at Interface._line (readline.js:426:8)
    at Interface._ttyWrite (readline.js:603:14)
    at ReadStream.<anonymous> (readline.js:82:12)
    at ReadStream.emit (events.js:88:20)

Revision history for this message
Matt Borland (palecrow) wrote :

So, since the Nova service is responding with Infinity, is this a Nova bug? It's not proper JSON.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/220518

Changed in horizon:
assignee: nobody → Matt Borland (palecrow)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Matt Borland (<email address hidden>) on branch: master
Review: https://review.openstack.org/220518
Reason: Abandoned in favor of: https://review.openstack.org/#/c/215196/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.