<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks folks for the interesting suggestions on this topic!  I’ll b updating the BP this week with this and other info i am gathering. <div><br></div><div>Please let me know if you are interested in being involved in brainstorming on this issue and I will set up an irc meeting to discuss it further<div><br><div><div>On Nov 11, 2013, at 3:08 PM, Mark McLoughlin <<a href="mailto:markmc@redhat.com">markmc@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi Nikola,<br><br>On Mon, 2013-11-11 at 12:44 +0100, Nikola Đipanov wrote:<br><blockquote type="cite">Hey all,<br><br>During the summit session on the the VMWare driver roadmap, a topic of<br>validating the passed configuration prior to starting services came up<br>(see [1] for more detail on how it's connected to that specific topic).<br><br>Several ideas were thrown around during the session mostly documented in<br>[1].<br><br>There are a few more cases when something like this could be useful (see<br>bug [2] and related patch [3]), and I was wondering if a slightly<br>different approach might be useful. For example use an already existing<br>validation hook in the service class [4] to call into a validation<br>framework that will potentially stop the service with proper<br>logging/notifications. The obvious benefit would be that there is no<br>pre-run required from the user, and the danger of running a<br>misconfigured stack is smaller.<br></blockquote><br>One thing worth trying would be to encode the validation rules in the<br>config option declaration.<br><br>Some rules could be straightforward, like:<br><br>opts = [<br> StrOpt('foo_url',<br>        validate_rule=cfg.MatchesRegexp('(git|http)://')),<br>]<br><br>but the rule you describe is more complex e.g.<br><br>def validate_proxy_url(conf, group, key, value):<br>   if not conf.vnc_enabled:<br>       return<br>   if conf.ssl_only and value.startswith("http://"):<br>       raise ValueError('ssl_only option detected, but ...')<br><br>opts = [<br> StrOpt('novncproxy_base_url',<br>        validate_rule=validate_proxy_url),<br> ...<br>]<br><br>I'm not sure I love this yet, but it's worth experimenting with.<br><br>Mark.<br><br><br>_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></div></blockquote></div><br></div></div></body></html>