Earlier  
Posted Nick Remark
#openstack-nova - 2017-01-12
10:23:57 alex_xu johnthetubaguy: i'm not sure json-schema have a way to extend the type, I need to check that
10:24:39 johnthetubaguy I mean they are all strings in query string params anyways
10:25:55 gmann but we do convert those into list of values for validation, so they are array for schema
10:26:26 johnthetubaguy well, I guess I mean everything is a list of strings
10:27:36 gmann yea but json schema just ignore format validation and pass if instance is not string
10:28:52 alex_xu johnthetubaguy: gmann we can add new type. but I guess there is no way to change the error message. User will get a message about "this isn't a type of reject_always"
10:29:02 johnthetubaguy doh
10:29:05 johnthetubaguy good point
10:29:17 johnthetubaguy why are we moving away from the decorator approach?
10:30:38 alex_xu johnthetubaguy: probably avoid one more decorator, and we put all the info into the schema: it is not part of in the schema and part of in the decorator
10:30:56 alex_xu johnthetubaguy: and Kevin_Zheng show me this https://review.openstack.org/#/c/419256/2/nova/api/validation/__init__.py, I feel the change is bigger than I thought
10:31:20 alex_xu But I guess there can be some code sharing, but another worry is another refactor for the code
10:31:25 johnthetubaguy we don't really need min and max though
10:31:29 johnthetubaguy I thought
10:31:36 johnthetubaguy not yet anyways
10:32:15 alex_xu it needs a version control
10:32:42 alex_xu in the future we may add new filter before we reject all?
10:32:51 gmann yea version things we can avoid as of not and do when microversion bump
10:32:56 alex_xu oops, sorry, that isn't the case
10:32:57 Kevin_Zheng yeah, otherwise we can just do it in schema with additional=false
10:32:58 gmann not->now
10:34:57 openstackgerrit zhangyujun proposed openstack/nova: Query parameter validation for hosts API https://review.openstack.org/418880
10:37:07 alex_xu when we reject all, that decorator still can be there.
10:39:38 alex_xu emm...so, yes, sounds like no version is ok
10:43:12 alex_xu johnthetubaguy: gmann Kevin_Zheng I guess the only different is we want to put all the info together, or just split that special case out of schema? is that question we should answer?
10:48:15 gmann alex_xu: you mean in case we add in schema with new formatter ?
10:48:57 alex_xu gmann: yes
10:49:12 gmann alex_xu: but 'format' only work if instance going to be validated is string and in our case it is list of values right
10:49:43 alex_xu gmann: we have macro function 'multi_params', that works for list
10:51:19 openstackgerrit Davanum Srinivas (dims) proposed openstack/nova: Better black list for py35 tests https://review.openstack.org/419250
10:52:00 gmann alex_xu: yea but instance (values) will be list and we would not be able to define like {"system_metadata": {"type": "string", "format": "reject_always"}}
10:52:16 alex_xu gmann: here is https://github.com/openstack/nova/blob/master/nova/api/validation/parameter_types.py#L38
10:52:26 gmann we have to do like this - {"system_metadata": {multi_params, "format": "reject_always"}}
10:52:53 alex_xu gmann: sorry, it should be {"system_metadata": multi_params({"type": "string", "format": "reject_always"})}
10:54:01 gmann alex_xu: ahh i see, so that each item will be validated against "reject_always"
10:54:11 alex_xu gmann: yea
10:54:38 alex_xu but have to say reject_always format is another hacky thing. is it decorator more explicitly?
10:55:09 alex_xu s/is it decorator/ is decorator/
10:55:51 alex_xu s/explicitly/explicity/...
10:56:02 gmann humm, another issue may be error message otherwise i like new formatter way
10:56:24 gmann alex_xu: but we can catch and format error message which will be other hack but wotrks
10:57:46 alex_xu gmann: yea, we already have one case https://github.com/openstack/nova/blob/master/nova/api/validation/validators.py#L264, then probably add another one
10:57:48 gmann johnthetubaguy: i think string thing solved here as alex_xu mentioned we can validate against each item of list and 'format' works
10:58:06 gmann alex_xu: :) aboout to give that example
10:58:25 gmann alex_xu: i am +1 with new formatter.
10:58:32 alex_xu gmann: :)
10:58:56 gmann alex_xu: johnthetubaguy have to rush for train. ll see log later
10:59:34 alex_xu gmann: yea, I have to go home also, back later
11:02:36 openstackgerrit Zhenyu Zheng proposed openstack/nova: [poc] add a decorator to reject know bad filters. https://review.openstack.org/419256
11:20:22 openstackgerrit Zhenyu Zheng proposed openstack/nova: [poc] add a decorator to reject know bad filters. https://review.openstack.org/419256
11:21:02 openstackgerrit zhangyujun proposed openstack/nova: Update JSON Schema for flavor access https://review.openstack.org/418683
11:38:38 openstackgerrit Zhihai Song proposed openstack/nova: Update py35 functional tests blacklist https://review.openstack.org/415149
11:39:51 openstackgerrit Gábor Antal proposed openstack/nova: Transform instance.volume_attach notification https://review.openstack.org/401992
11:49:14 openstackgerrit Wang Qing wu proposed openstack/nova: WIP(4): Introduce base PowerVM driver (cfg drv) https://review.openstack.org/409404
11:57:46 openstackgerrit Zhenyu Zheng proposed openstack/nova: [poc] add a decorator to reject know bad filters. https://review.openstack.org/419256
11:59:48 openstackgerrit Zhihai Song proposed openstack/nova: Enable tests.functional.db.api.test_migrations for py35 https://review.openstack.org/419435
12:02:02 openstackgerrit Zhenyu Zheng proposed openstack/nova: [poc] add a decorator to reject know bad filters. https://review.openstack.org/419256
12:02:48 openstackgerrit Gábor Antal proposed openstack/nova: Transform instance.volume_attach notification https://review.openstack.org/401992
12:13:02 openstackgerrit Gábor Antal proposed openstack/nova: Transform instance.volume_detach notification https://review.openstack.org/408676
12:15:11 openstackgerrit Béla Vancsics proposed openstack/nova: Reduce code duplication https://review.openstack.org/270911
12:21:25 openstackgerrit Istvan Imre proposed openstack/python-novaclient: Pass relevant parameters to Token based authentication https://review.openstack.org/419441
12:24:17 openstackgerrit Zhihai Song proposed openstack/nova: Update py35 functional tests blacklist https://review.openstack.org/415149
12:31:42 dims mriedem : bauzas : the review for the py35 functional test blacklist is ready - https://review.openstack.org/#/c/419250/
12:42:30 openstackgerrit Chris Dent proposed openstack/nova: Small improvements to placement.rst https://review.openstack.org/403811
12:46:42 cdent mriedem, bauzas : can we get that merged or otherwise reviewed? Or if not, let me know so I can abandon it.
12:50:50 openstackgerrit Béla Vancsics proposed openstack/nova: Reduced the complexity of the _init_instance method https://review.openstack.org/374661
12:53:42 openstackgerrit John Garbutt proposed openstack/nova: Pass objects into _create_ports_for_instance https://review.openstack.org/418512
13:02:26 bauzas cdent: looking
13:02:38 cdent thanks
13:03:01 bauzas cdent: +2d
13:03:08 cdent more thanks!
13:03:12 bauzas cdent: I'll abandon my doc patch changing the port number
13:13:42 gibi hi nova!
13:13:50 gibi I have a question about lazy-loaded fields
13:13:55 cdent hi gibi !
13:14:05 cdent (someone has had their coffee today)
13:14:14 gibi cdent: :)
13:14:36 gibi Do I see correctly that instance.flavor.projects access is a double lazy-load?
13:14:45 gibi and that it will not work
13:14:54 gibi as when the flavor is loaded into the instance
13:15:00 gibi then the Flavor object is orphaned
13:15:05 gibi https://github.com/openstack/nova/blob/master/nova/objects/instance.py#L315
13:16:29 gibi so I have an instance object
13:16:40 gibi and I access instance.flavor
13:16:48 gibi which will lazy load the Falvor object
13:17:10 gibi and then I try to access the projects field of that Flavor object that is again a lazy load
13:17:18 gibi then that is fails as the Falvor object is orphaned
13:18:30 gibi I started here https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L5031
13:18:36 gibi with an instance
13:19:07 gibi then that notification sending first access instance.flavor and that is OK as the instance is not orphaned
13:19:23 gibi but after that the code needs instance.flavor.projects and that fails
13:19:28 cdent gibi: this is the sort of question I'd love to see on the mailing list so that the response is preserved somewhere more readable by more people than IRC. Also I don't know the answer :)
13:19:37 gibi OrphanedObjectError: Cannot call _load_projects on orphaned Flavor object
13:19:52 gibi cdent: OK, I post to ML
13:21:17 cdent it looks like those flavor objects being created never get a context?
13:22:42 openstackgerrit Zhenyu Zheng proposed openstack/nova: [poc] add some code to reject known bad filters. https://review.openstack.org/419256
13:22:49 gibi yes, it seems to me the context is missingf
13:23:56 cdent which presumably means someone wanted to make sure you can't do what you're trying to do? :)
13:24:41 gibi I'm not sure about that
13:25:25 gibi I think it is more likely that we forgot the context there

Earlier   Later