quattor / aquilon

Configuration Management Database (3rd Generation)
www.quattor.org
Apache License 2.0
15 stars 20 forks source link

Aquilon object names are not allowed to start with a digit #54

Open jouvin opened 7 years ago

jouvin commented 7 years ago

Object names like rooms, buildings... are not allowed to start with a digit. Is there a good reason for this restriction? A typical naming of rooms at our site is like 206-1-001 meaning the room 001 on the first floor of building 206. It would good if we could enter this "standard" name rather than rewrite it for Aquilon.

jrha commented 7 years ago

Normally because they are used as dict keys and they also cannot start with a digit. You can always prefix them with 'room' or _

jouvin commented 7 years ago

At least this should be stated clearly in the online help text... I have the feeling that ideally it should be the internal business of Aquilon to transform the value in a valid identifier internally (like we do with escape() in templates).

stdweird commented 7 years ago

should fix that in pan also (and also get rid of escape while we're at it 😁 ). why can't pan dict keys start with a digit anyway? (i understand why they can't be only digits)

jouvin commented 7 years ago

@stdweird I mentioned pan just an example of converting the user value to an internally acceptable one. I don't want to push the same approach. Let's avoid to discuss panc here (despite you are right, I think there is no more problem with a pan dict key starting with a digit). My point is only that for me a good product should not impose restriction to values meaningful for a user because of internal constraints: it should do/manage the mapping.

stdweird commented 7 years ago

wrt pan dict keys: https://github.com/quattor/pan/issues/156

ned21 commented 7 years ago

Discussed at RAL workshop. Aquilon is doing the right thing while PAN enforces this so will keep open until quattor/pan#156 is fixed and then revisit.

jrha commented 7 years ago

For reference, the current error message is... Bad Request: '42' is not a valid value for Building.

ned21 commented 7 years ago

Identifiers are also used as template names so in addition to quattor/pan#156 we also need to check that PAN allows template names to start with a digit.

Update: confirms that a template called "42.pan" works correctly. The issue (at the moment) with using a templates called features/42.pan with aquilon is that is then incompatible with feature parameters since /system/features/42 is not a valid PAN path (and will continue not to be a valid one even after pan#156 is fixed).