Tuesday, 2015-06-30

openstackgerritAlex Xu proposed openstack/api-wg: Clarify the return code when server have hard-code length limit  https://review.openstack.org/18178400:16
openstackgerritKen'ichi Ohmichi proposed openstack/api-wg: Add generic name of each project for terms  https://review.openstack.org/19691800:29
*** gmann has quit IRC00:48
*** gmann has joined #openstack-api01:00
*** annegentle has joined #openstack-api01:02
*** annegentle has quit IRC01:06
*** sigmavirus24 is now known as sigmavirus24_awa01:13
*** Apoorva has quit IRC01:50
*** sigmavirus24_awa is now known as sigmavirus2402:05
*** woodster_ has quit IRC03:11
*** Apoorva has joined #openstack-api03:47
*** sigmavirus24 is now known as sigmavirus24_awa04:39
*** Apoorva has quit IRC05:08
openstackgerritAlex Xu proposed openstack/api-wg: Clarify the return code when server have hard-code length limit  https://review.openstack.org/18178405:47
*** subscope has quit IRC07:31
*** e0ne has joined #openstack-api07:33
*** e0ne has quit IRC07:37
*** subscope has joined #openstack-api07:47
*** subscope has quit IRC07:55
*** lucasagomes has joined #openstack-api08:05
*** subscope has joined #openstack-api08:11
*** subscope has quit IRC08:24
*** subscope has joined #openstack-api08:38
*** alex_xu_ is now known as alex_xu08:38
*** e0ne has joined #openstack-api09:02
*** e0ne is now known as e0ne_09:15
*** e0ne_ has quit IRC09:26
*** e0ne has joined #openstack-api09:29
*** subscope has quit IRC09:44
*** subscope has joined #openstack-api10:01
*** fzdarsky has joined #openstack-api10:13
*** e0ne is now known as e0ne_10:23
*** e0ne_ is now known as e0ne10:25
*** fzdarsky has quit IRC11:01
*** subscope has quit IRC11:31
*** subscope has joined #openstack-api11:47
*** subscope has quit IRC12:17
*** fzdarsky has joined #openstack-api12:19
*** lucasagomes is now known as lucas-hungry12:30
*** Guest27041 has joined #openstack-api12:51
*** Guest27041 is now known as agentle13:21
openstackgerritKen'ichi Ohmichi proposed openstack/api-wg: Add generic name of each project for terms  https://review.openstack.org/19691813:28
*** e0ne is now known as e0ne_13:29
*** lucas-hungry is now known as lucasagomes13:32
*** e0ne_ has quit IRC13:39
*** sigmavirus24_awa is now known as sigmavirus2413:40
*** agentle has quit IRC13:43
*** e0ne has joined #openstack-api13:46
openstackgerritMerged openstack/api-wg: http guideline expansion: background  https://review.openstack.org/18193114:01
*** annegentle has joined #openstack-api14:14
*** Apoorva has joined #openstack-api14:37
*** subscope has joined #openstack-api14:52
*** e0ne is now known as e0ne_14:55
*** notmars has joined #openstack-api14:58
*** e0ne_ is now known as e0ne14:58
*** e0ne is now known as e0ne_14:59
*** e0ne_ is now known as e0ne14:59
*** fzdarsky has quit IRC16:04
*** notmars has quit IRC16:21
*** e0ne is now known as e0ne_16:23
*** dontalton has joined #openstack-api16:29
*** e0ne_ has quit IRC16:34
*** e0ne has joined #openstack-api16:36
*** openstackgerrit has quit IRC16:50
*** openstackgerrit has joined #openstack-api16:51
*** lucasagomes is now known as lucas-dinner17:02
*** e0ne has quit IRC17:05
*** notmars has joined #openstack-api17:13
*** annegentle has quit IRC17:28
*** annegentle has joined #openstack-api17:41
*** crossbeau has joined #openstack-api17:47
crossbeauhas anyone here worked with Apache Libcloud?17:48
elmikonot i17:48
elmikolooks neat though17:48
crossbeauso far it is, but dealing with multiple networks is being a butt17:49
elmikoheh, i can only imagine17:49
crossbeauthe documentation for specifying the network does not exist -___- but it looks like it can be specified17:50
elmikoouch17:50
crossbeauI found this: #networks = [{'uuid': network.id} for network in networks]17:52
crossbeaubut I can't figure out what it is looking for17:52
elmikosounds like the resource id for whatever network you are selecting17:53
elmikoare you curious about how this interacts with openstack?17:53
crossbeauI have tried, networks=[{'net-id':network.id}]17:54
crossbeaui just want to know what goes where17:54
elmikoahh, so what k:v that libcloud is looking for?17:55
crossbeauk:v?17:55
elmikokey:value17:55
elmikoif i follow what you are saying, you are wondering what that dictionary should look like for each network that you provode to libcloud?17:56
elmiko*provide17:56
elmikoare is this what you are getting from libcloud?17:56
crossbeauyeah it wants me to fillout networks = [{'uuid': network.id} for network in networks]17:57
crossbeaumy network I want to use is ship-net17:57
elmikoi'm not familiar with ship-net, it sounds like it just wants the network ids that exist in the cloud though. for example, as created by neutron.17:58
*** e0ne has joined #openstack-api17:58
elmikotake that with a huge grain of salt though, as i have no idea about libcloud lol17:59
crossbeauno, my network that I built is ship-net17:59
crossbeauso I tried18:00
crossbeau[{'uuid-of-ship-net':ship-net} for network in networks]18:00
elmikoshouldn't that be {'uuid': uuid-of-ship-net} ?18:01
crossbeauso '"uuid"':actual uuid-of-ship-net?18:01
elmikothat's how i read it, based on your description18:01
crossbeaulet me try that18:02
crossbeaunope18:04
*** e0ne is now known as e0ne_18:04
crossbeauex_userdata=cloud_init_config, ex_config_drive=True, networks= networks = [{'uuid': 3d7e4783-35c3-41d2-924f-40efc138f50a } for network in networks])18:05
crossbeau                                                                            ^18:05
crossbeauSyntaxError: invalid syntax18:05
elmikodid you mean to have `networks= networks = ` twice, or is that just the error output?18:06
crossbeaunope18:07
elmikoalso, i would imagine you'd need to quote the uuid18:07
*** e0ne_ is now known as e0ne18:07
elmikomaybe just do , network=[{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}]18:07
elmikoand skip the loop18:07
elmikoer, networks=.....18:07
crossbeauFile "nettest.py", line 35, in <module>18:08
crossbeau    ex_userdata=cloud_init_config, ex_config_drive=True,networks = [{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}])18:08
crossbeau  File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/openstack.py", line 1189, in create_node18:08
crossbeau    server_params = self._create_args_to_params(None, **kwargs)18:08
crossbeau  File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/openstack.py", line 1279, in _create_args_to_params18:08
crossbeau    networks = [{'uuid': network.id} for network in networks]18:08
crossbeauAttributeError: 'dict' object has no attribute 'id'18:08
elmikoso, network.get('id') ?18:08
elmikoyou might need to inspect those network dicts to see what they look like18:09
crossbeauI dont believe there is a network.get("id")18:09
elmikothat error seems to indicate that network is a dict, which means it has a get() by default. (assuming this is python)18:10
crossbeauI wish I could just force it the specific ID18:10
crossbeauyeah its python18:10
elmikowhy can't you just force it with, networks=[{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}] ?18:10
crossbeaubecause of the syntax error I just showed u18:10
elmikothe line i just posted is different from what you had, and it's valid python18:11
crossbeaunoded = driver.create_node(name='cloud_init', image=image, size=size,18:11
crossbeau                          ex_userdata=cloud_init_config, ex_config_drive=True,networks = [{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}])18:11
crossbeauthat is my syntax18:11
elmikolooks ok18:11
elmikoi mean, it looks like valid python18:12
crossbeauif 'networks' in kwargs:18:13
crossbeau            networks = kwargs['networks']18:13
crossbeau            networks = [{'uuid': network.id} for network in networks]18:13
crossbeau            server_params['networks'] = networks18:13
*** annegentle has quit IRC18:13
crossbeauthis is all they had in their definitions for networks =18:13
elmikomakes some sense, looks like networks just needs to be a list of dictionaries with a single key:value in each18:14
*** notmars has quit IRC18:14
crossbeauwhat does that mean haha, I am not the most well versed programmer18:16
*** annegentle has joined #openstack-api18:16
elmikooh, well {'uuid': network.id} is a dictionary with 'uuid' as the key, and network.id as the value18:16
elmikoand [] indicates a list18:16
elmikoso the comprehension [{'uuid': network.id} for network in networks] will create a list of dictionaries18:17
elmikoit will loop through all the values in networks and create the list from that information18:17
elmikothat's why i suggested the shortcut of [{'uuid': 'ship-nets-uuid'}]18:18
*** e0ne is now known as e0ne_18:18
crossbeauwhich I did and it still failed18:18
elmikothat just creates a list of 1 dictionary that explicitly has the uuid you are looking for18:18
elmikoweird...18:18
crossbeaunoded = driver.create_node(name='cloud_init', image=image, size=size,18:18
crossbeau                          ex_userdata=cloud_init_config, ex_config_drive=True,networks = [{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}])18:18
elmikoand what error does that produce?18:18
crossbeauTraceback (most recent call last):18:19
crossbeau  File "nettest.py", line 35, in <module>18:19
crossbeau    ex_userdata=cloud_init_config, ex_config_drive=True,networks = [{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}])18:19
crossbeau  File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/openstack.py", line 1189, in create_node18:19
crossbeau    server_params = self._create_args_to_params(None, **kwargs)18:19
crossbeau  File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/openstack.py", line 1279, in _create_args_to_params18:19
crossbeau    networks = [{'uuid': network.id} for network in networks]18:19
crossbeauAttributeError: 'dict' object has no attribute 'id'18:19
elmikooh...18:19
elmikoi misunderstood where that was coming from18:19
elmikolooks like you need to pass a list of networks in as the networks= value18:19
crossbeauso it can't just be one?18:20
elmikoso something like, networks=[ship-net]18:20
elmikoprobably, it just needs to be a list of one. i'm guessing18:20
crossbeaunetworks=[ship-net] or networks=[ship-net's uuid] ?18:20
elmikothe first, because it looks like the code in create_node wants a list of network objets18:21
elmikoobjects18:21
crossbeauhmmm that makes sense18:21
crossbeauso grabbing the whole table?18:21
elmikoassuming that shipnet.id evaluates to something...18:21
elmikoi'd guess, it really depends what the object you're using for ship-net looks like18:22
crossbeaudo I have to define it?18:22
elmikoas far as that section of code from create_node you showed me, it just needs objects that contain a member named "id"18:22
elmikonot sure, can you use pastebin to share the code you are using?18:23
*** e0ne_ is now known as e0ne18:23
crossbeauhttp://pastebin.com/Jefx44sg18:25
crossbeauI just found these:  def _to_networks(self, obj):18:25
crossbeau        networks = obj['networks']18:25
crossbeau        return [self._to_network(network) for network in networks]18:25
crossbeau    def _to_network(self, obj):18:25
crossbeau        return OpenStackNetwork(id=obj['id'],18:25
crossbeau                                name=obj['label'],18:25
crossbeau                                cidr=obj.get('cidr', None),18:25
crossbeau                                driver=self)18:25
crossbeau[docs]    def ex_list_networks(self):18:25
crossbeau        """18:25
crossbeau        Get a list of Networks that are available.18:25
crossbeau        :rtype: ``list`` of :class:`OpenStackNetwork`18:25
crossbeau        """18:25
crossbeau        response = self.connection.request(self._networks_url_prefix).object18:25
crossbeauhttp://pastebin.com/F5LR3zWE18:26
crossbeauI found this should I be running these first18:26
elmikomakes sense18:26
crossbeauok ill poke with those to define the network list and then see where that takes me :018:27
crossbeau*:)18:27
crossbeauty18:27
elmikoso yea, looks like somehow you will need to create a netowkr object.18:27
elmikonp, gl =)18:27
crossbeauyeah, those look like that will do it18:27
elmikoyea18:27
elmikoyou're close ;)18:27
crossbeauand then I can use that to define a network object and then I can do networks = [network]18:27
elmikoright18:27
elmiko(theoretically)18:27
crossbeausweet :)18:27
crossbeau*fingers crossed18:27
elmikohehe18:27
crossbeaualso other than this lib cloud has been cool18:28
crossbeauseems really powerful18:28
*** crossbeau has quit IRC18:30
*** terrylhowe has quit IRC18:37
*** annegentle has quit IRC18:43
*** terrylhowe has joined #openstack-api18:45
*** Guest80179 has joined #openstack-api19:06
*** e0ne is now known as e0ne_19:14
*** Guest80179 has quit IRC19:14
*** e0ne_ is now known as e0ne19:15
*** Apoorva has quit IRC20:03
*** Apoorva has joined #openstack-api20:04
*** e0ne has quit IRC20:35
*** amit213 has quit IRC20:44
*** amit213 has joined #openstack-api20:44
*** amit213 has quit IRC20:44
*** lucas-dinner has quit IRC21:14
*** fifieldt has quit IRC21:39
*** fifieldt has joined #openstack-api21:51
*** dontalton has quit IRC22:37

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