On 06/03/11 - 03:58:24PM, Michal Fojtik wrote: > On Jun 3, 2011, at 3:37 PM, Chris Lalancette wrote: > > > The different deltacloud drivers were all handling names a > > bit differently. This series rationalizes the drivers so > > that: > > > > 1) If a name is provided by the user (opts[:name]), we > > use that to start with > > 2) If a name is not provided, then we generate one > > 3) We then check that the name conforms to the rules for > > the cloud backend. If the name does not conform, we throw > > an error > > Actually I think it would be better to handle constrains in more > abstract way. > > I'm thinking about using 'param' method in Rabbit DSL to provide > additional support for parameter validation like length / format. > Then it should be easy to advertise that by whatever method we will > choose. > Also different drivers should override these values to fit backend > requirements. > Once this will be done the checking you made for name length will be > duplicated.
We certainly could do it that way, though it seems like overkill to me. The restrictions on the name are very backend specific, so it makes sense to me that the checking on them go in the individual drivers. -- Chris Lalancette
