m2 icon indicating copy to clipboard operation
m2 copied to clipboard

Running "bmi pro ..." command with the same parameters throws sqlalchemy error to the user

Open sirushtim opened this issue 8 years ago • 5 comments

Provisioning a node again with the same parametres throws an sqlalchemy error. Replace this exception with an error message that is more generic for the user.

Example:- bmi pro bmi_infra some_bmi_node ok bmi_network 1 ORM related error = (sqlite3.IntegrityError) UNIQUE constraint failed: image.project_id, image.name

sirushtim avatar Jan 26 '17 01:01 sirushtim

This can be done by creating a new exception, catching sqlite3.IntegrityError and raising the new exception with the required message. Perfect for newbies!!

chemistry-sourabh avatar Jan 26 '17 01:01 chemistry-sourabh

^+1. Also note, that the code in the api must be taken care of to return the correct error code i.e 409 in this case which makes this a tad bit more complicated.

sirushtim avatar Feb 01 '17 01:02 sirushtim

For all BMI related commands, first review the architecture of cli and then proceed. This is true for all issues raised wrt cli.

ravisantoshgudimetla avatar Feb 03 '17 14:02 ravisantoshgudimetla

@chemistry-sourabh @naved001 can we close this?

apoorvemohan avatar Feb 12 '18 21:02 apoorvemohan

It doesn't look like it is resolved.

if somebody wants to fix this in the current version of bmi, they can.

naved001 avatar Feb 12 '18 21:02 naved001