Sunday, 2015-01-04

*** pm90_ has quit IRC00:26
*** pm90_ has joined #openstack-sdks00:27
*** briancurtin has joined #openstack-sdks00:51
*** briancurtin has joined #openstack-sdks00:51
*** stevemar has joined #openstack-sdks00:56
*** briancurtin has quit IRC02:18
*** sigmavirus24_awa is now known as sigmavirus2402:33
stevemarsigmavirus24, ping03:27
sigmavirus24stevemar: sup?03:33
stevemarsigmavirus24, i have a random python question that is bugging me... if you are free-ish03:33
stevemaroutlined here: http://paste.openstack.org/show/155489/ it feels like such a noobie question03:34
* sigmavirus24 looks03:36
openstackgerritZhiyuan Cai proposed openstack/python-openstackclient: Check if service.name available before access  https://review.openstack.org/14485703:36
sigmavirus24if you're looking to de-dup Users you need to define __hash__03:36
sigmavirus24on Py2 by default it uses id(obj)03:36
sigmavirus24on Py3 that would be busted iirc03:36
stevemarsigmavirus24, ahhh okay, i guess you would need for define __hash__ anytime you use objects?03:37
sigmavirus24not necessarily every time, but anytime you're defining a custom object and you want it to hash consistently, yes03:39
sigmavirus24so if you want any instance of User with id 1234 to be able to be used as a key in a dictionary (or to be the same in a set) you need to define __hash__03:40
sigmavirus24and all it need return is an id03:40
stevemarokay, i'll look into that, but if it's broken in py33 then that's nothing i want to use :(03:41
stevemarif all else fails, i'll use: http://paste.openstack.org/show/155495/03:41
stevemarit's not as pretty, but it'll work03:42
sigmavirus24stevemar: sorry, __hash__ isn't broken03:42
sigmavirus24relying on id(obj) is broken03:42
sigmavirus24so what your'e doing now would break because those objects aren't explicitly hashable03:42
stevemarso it should probably be defined here https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/v3/users.py#L27-L3403:46
sigmavirus24stevemar: fwiw, with GitHub's API, every object has a url attribute and I use hash(url)03:46
sigmavirus24stevemar: or it could be on keystoneclient.base.Resource03:46
sigmavirus24which seems to come from oslo-incubator's apiclient03:48
stevemaryep, or there too03:48
stevemari think they use id(obj) as you mentioned03:48
sigmavirus24That's just what python defaults to :( https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/openstack/common/apiclient/base.py#L42603:49
sigmavirus24They're not defining it03:49
stevemarnice03:54
sigmavirus24I really kind of want oslo-incubator's apiclient to be so much better/more than it is03:54
sigmavirus24I couldn't find any blueprints around it though03:55
sigmavirus24(perhaps didn't look in the right place)03:55
sigmavirus24I also wonder how necessary it is now with the sdk03:55
stevemarsigmavirus24, well the sdk is still a bit a ways away03:59
stevemar(i think so anyway)03:59
sigmavirus24Yeah I get that04:07
*** pm90_ has quit IRC04:13
*** sigmavirus24 is now known as sigmavirus24_awa04:54
openstackgerritMerged openstack/python-openstackclient: Add endpoint v3 docs  https://review.openstack.org/14454005:07
openstackgerritOpenStack Proposal Bot proposed openstack/python-openstackclient: Imported Translations from Transifex  https://review.openstack.org/14482906:11
openstackgerritSteve Martinelli proposed openstack/python-openstackclient: Allow user list to filter by project  https://review.openstack.org/14221006:44
*** stevemar has quit IRC07:13
*** stevemar has joined #openstack-sdks14:55
*** sigmavirus24_awa is now known as sigmavirus2415:34
*** briancurtin has joined #openstack-sdks16:25
*** briancurtin has quit IRC16:35
*** subscope has joined #openstack-sdks17:44
*** subscope has quit IRC18:00
*** stevemar has quit IRC18:19
*** pm90_ has joined #openstack-sdks22:38
*** notmyname_ has joined #openstack-sdks23:03
*** pm90_ has quit IRC23:04
*** notmyname has quit IRC23:06
*** notmyname_ is now known as notmyname23:06

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!