openstackgerrit | Alex Xu proposed openstack/api-wg: Clarify the return code when server have hard-code length limit https://review.openstack.org/181784 | 00:16 |
---|---|---|
openstackgerrit | Ken'ichi Ohmichi proposed openstack/api-wg: Add generic name of each project for terms https://review.openstack.org/196918 | 00:29 |
*** gmann has quit IRC | 00:48 | |
*** gmann has joined #openstack-api | 01:00 | |
*** annegentle has joined #openstack-api | 01:02 | |
*** annegentle has quit IRC | 01:06 | |
*** sigmavirus24 is now known as sigmavirus24_awa | 01:13 | |
*** Apoorva has quit IRC | 01:50 | |
*** sigmavirus24_awa is now known as sigmavirus24 | 02:05 | |
*** woodster_ has quit IRC | 03:11 | |
*** Apoorva has joined #openstack-api | 03:47 | |
*** sigmavirus24 is now known as sigmavirus24_awa | 04:39 | |
*** Apoorva has quit IRC | 05:08 | |
openstackgerrit | Alex Xu proposed openstack/api-wg: Clarify the return code when server have hard-code length limit https://review.openstack.org/181784 | 05:47 |
*** subscope has quit IRC | 07:31 | |
*** e0ne has joined #openstack-api | 07:33 | |
*** e0ne has quit IRC | 07:37 | |
*** subscope has joined #openstack-api | 07:47 | |
*** subscope has quit IRC | 07:55 | |
*** lucasagomes has joined #openstack-api | 08:05 | |
*** subscope has joined #openstack-api | 08:11 | |
*** subscope has quit IRC | 08:24 | |
*** subscope has joined #openstack-api | 08:38 | |
*** alex_xu_ is now known as alex_xu | 08:38 | |
*** e0ne has joined #openstack-api | 09:02 | |
*** e0ne is now known as e0ne_ | 09:15 | |
*** e0ne_ has quit IRC | 09:26 | |
*** e0ne has joined #openstack-api | 09:29 | |
*** subscope has quit IRC | 09:44 | |
*** subscope has joined #openstack-api | 10:01 | |
*** fzdarsky has joined #openstack-api | 10:13 | |
*** e0ne is now known as e0ne_ | 10:23 | |
*** e0ne_ is now known as e0ne | 10:25 | |
*** fzdarsky has quit IRC | 11:01 | |
*** subscope has quit IRC | 11:31 | |
*** subscope has joined #openstack-api | 11:47 | |
*** subscope has quit IRC | 12:17 | |
*** fzdarsky has joined #openstack-api | 12:19 | |
*** lucasagomes is now known as lucas-hungry | 12:30 | |
*** Guest27041 has joined #openstack-api | 12:51 | |
*** Guest27041 is now known as agentle | 13:21 | |
openstackgerrit | Ken'ichi Ohmichi proposed openstack/api-wg: Add generic name of each project for terms https://review.openstack.org/196918 | 13:28 |
*** e0ne is now known as e0ne_ | 13:29 | |
*** lucas-hungry is now known as lucasagomes | 13:32 | |
*** e0ne_ has quit IRC | 13:39 | |
*** sigmavirus24_awa is now known as sigmavirus24 | 13:40 | |
*** agentle has quit IRC | 13:43 | |
*** e0ne has joined #openstack-api | 13:46 | |
openstackgerrit | Merged openstack/api-wg: http guideline expansion: background https://review.openstack.org/181931 | 14:01 |
*** annegentle has joined #openstack-api | 14:14 | |
*** Apoorva has joined #openstack-api | 14:37 | |
*** subscope has joined #openstack-api | 14:52 | |
*** e0ne is now known as e0ne_ | 14:55 | |
*** notmars has joined #openstack-api | 14:58 | |
*** e0ne_ is now known as e0ne | 14:58 | |
*** e0ne is now known as e0ne_ | 14:59 | |
*** e0ne_ is now known as e0ne | 14:59 | |
*** fzdarsky has quit IRC | 16:04 | |
*** notmars has quit IRC | 16:21 | |
*** e0ne is now known as e0ne_ | 16:23 | |
*** dontalton has joined #openstack-api | 16:29 | |
*** e0ne_ has quit IRC | 16:34 | |
*** e0ne has joined #openstack-api | 16:36 | |
*** openstackgerrit has quit IRC | 16:50 | |
*** openstackgerrit has joined #openstack-api | 16:51 | |
*** lucasagomes is now known as lucas-dinner | 17:02 | |
*** e0ne has quit IRC | 17:05 | |
*** notmars has joined #openstack-api | 17:13 | |
*** annegentle has quit IRC | 17:28 | |
*** annegentle has joined #openstack-api | 17:41 | |
*** crossbeau has joined #openstack-api | 17:47 | |
crossbeau | has anyone here worked with Apache Libcloud? | 17:48 |
elmiko | not i | 17:48 |
elmiko | looks neat though | 17:48 |
crossbeau | so far it is, but dealing with multiple networks is being a butt | 17:49 |
elmiko | heh, i can only imagine | 17:49 |
crossbeau | the documentation for specifying the network does not exist -___- but it looks like it can be specified | 17:50 |
elmiko | ouch | 17:50 |
crossbeau | I found this: #networks = [{'uuid': network.id} for network in networks] | 17:52 |
crossbeau | but I can't figure out what it is looking for | 17:52 |
elmiko | sounds like the resource id for whatever network you are selecting | 17:53 |
elmiko | are you curious about how this interacts with openstack? | 17:53 |
crossbeau | I have tried, networks=[{'net-id':network.id}] | 17:54 |
crossbeau | i just want to know what goes where | 17:54 |
elmiko | ahh, so what k:v that libcloud is looking for? | 17:55 |
crossbeau | k:v? | 17:55 |
elmiko | key:value | 17:55 |
elmiko | if 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 | *provide | 17:56 |
elmiko | are is this what you are getting from libcloud? | 17:56 |
crossbeau | yeah it wants me to fillout networks = [{'uuid': network.id} for network in networks] | 17:57 |
crossbeau | my network I want to use is ship-net | 17:57 |
elmiko | i'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-api | 17:58 | |
elmiko | take that with a huge grain of salt though, as i have no idea about libcloud lol | 17:59 |
crossbeau | no, my network that I built is ship-net | 17:59 |
crossbeau | so I tried | 18:00 |
crossbeau | [{'uuid-of-ship-net':ship-net} for network in networks] | 18:00 |
elmiko | shouldn't that be {'uuid': uuid-of-ship-net} ? | 18:01 |
crossbeau | so '"uuid"':actual uuid-of-ship-net? | 18:01 |
elmiko | that's how i read it, based on your description | 18:01 |
crossbeau | let me try that | 18:02 |
crossbeau | nope | 18:04 |
*** e0ne is now known as e0ne_ | 18:04 | |
crossbeau | ex_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 |
crossbeau | SyntaxError: invalid syntax | 18:05 |
elmiko | did you mean to have `networks= networks = ` twice, or is that just the error output? | 18:06 |
crossbeau | nope | 18:07 |
elmiko | also, i would imagine you'd need to quote the uuid | 18:07 |
*** e0ne_ is now known as e0ne | 18:07 | |
elmiko | maybe just do , network=[{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}] | 18:07 |
elmiko | and skip the loop | 18:07 |
elmiko | er, networks=..... | 18:07 |
crossbeau | File "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_node | 18: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_params | 18:08 |
crossbeau | networks = [{'uuid': network.id} for network in networks] | 18:08 |
crossbeau | AttributeError: 'dict' object has no attribute 'id' | 18:08 |
elmiko | so, network.get('id') ? | 18:08 |
elmiko | you might need to inspect those network dicts to see what they look like | 18:09 |
crossbeau | I dont believe there is a network.get("id") | 18:09 |
elmiko | that error seems to indicate that network is a dict, which means it has a get() by default. (assuming this is python) | 18:10 |
crossbeau | I wish I could just force it the specific ID | 18:10 |
crossbeau | yeah its python | 18:10 |
elmiko | why can't you just force it with, networks=[{'uuid': '3d7e4783-35c3-41d2-924f-40efc138f50a'}] ? | 18:10 |
crossbeau | because of the syntax error I just showed u | 18:10 |
elmiko | the line i just posted is different from what you had, and it's valid python | 18:11 |
crossbeau | noded = 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 |
crossbeau | that is my syntax | 18:11 |
elmiko | looks ok | 18:11 |
elmiko | i mean, it looks like valid python | 18:12 |
crossbeau | if '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'] = networks | 18:13 |
*** annegentle has quit IRC | 18:13 | |
crossbeau | this is all they had in their definitions for networks = | 18:13 |
elmiko | makes some sense, looks like networks just needs to be a list of dictionaries with a single key:value in each | 18:14 |
*** notmars has quit IRC | 18:14 | |
crossbeau | what does that mean haha, I am not the most well versed programmer | 18:16 |
*** annegentle has joined #openstack-api | 18:16 | |
elmiko | oh, well {'uuid': network.id} is a dictionary with 'uuid' as the key, and network.id as the value | 18:16 |
elmiko | and [] indicates a list | 18:16 |
elmiko | so the comprehension [{'uuid': network.id} for network in networks] will create a list of dictionaries | 18:17 |
elmiko | it will loop through all the values in networks and create the list from that information | 18:17 |
elmiko | that's why i suggested the shortcut of [{'uuid': 'ship-nets-uuid'}] | 18:18 |
*** e0ne is now known as e0ne_ | 18:18 | |
crossbeau | which I did and it still failed | 18:18 |
elmiko | that just creates a list of 1 dictionary that explicitly has the uuid you are looking for | 18:18 |
elmiko | weird... | 18:18 |
crossbeau | noded = 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 |
elmiko | and what error does that produce? | 18:18 |
crossbeau | Traceback (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_node | 18: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_params | 18:19 |
crossbeau | networks = [{'uuid': network.id} for network in networks] | 18:19 |
crossbeau | AttributeError: 'dict' object has no attribute 'id' | 18:19 |
elmiko | oh... | 18:19 |
elmiko | i misunderstood where that was coming from | 18:19 |
elmiko | looks like you need to pass a list of networks in as the networks= value | 18:19 |
crossbeau | so it can't just be one? | 18:20 |
elmiko | so something like, networks=[ship-net] | 18:20 |
elmiko | probably, it just needs to be a list of one. i'm guessing | 18:20 |
crossbeau | networks=[ship-net] or networks=[ship-net's uuid] ? | 18:20 |
elmiko | the first, because it looks like the code in create_node wants a list of network objets | 18:21 |
elmiko | objects | 18:21 |
crossbeau | hmmm that makes sense | 18:21 |
crossbeau | so grabbing the whole table? | 18:21 |
elmiko | assuming that shipnet.id evaluates to something... | 18:21 |
elmiko | i'd guess, it really depends what the object you're using for ship-net looks like | 18:22 |
crossbeau | do I have to define it? | 18:22 |
elmiko | as far as that section of code from create_node you showed me, it just needs objects that contain a member named "id" | 18:22 |
elmiko | not sure, can you use pastebin to share the code you are using? | 18:23 |
*** e0ne_ is now known as e0ne | 18:23 | |
crossbeau | http://pastebin.com/Jefx44sg | 18:25 |
crossbeau | I 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).object | 18:25 |
crossbeau | http://pastebin.com/F5LR3zWE | 18:26 |
crossbeau | I found this should I be running these first | 18:26 |
elmiko | makes sense | 18:26 |
crossbeau | ok ill poke with those to define the network list and then see where that takes me :0 | 18:27 |
crossbeau | *:) | 18:27 |
crossbeau | ty | 18:27 |
elmiko | so yea, looks like somehow you will need to create a netowkr object. | 18:27 |
elmiko | np, gl =) | 18:27 |
crossbeau | yeah, those look like that will do it | 18:27 |
elmiko | yea | 18:27 |
elmiko | you're close ;) | 18:27 |
crossbeau | and then I can use that to define a network object and then I can do networks = [network] | 18:27 |
elmiko | right | 18:27 |
elmiko | (theoretically) | 18:27 |
crossbeau | sweet :) | 18:27 |
crossbeau | *fingers crossed | 18:27 |
elmiko | hehe | 18:27 |
crossbeau | also other than this lib cloud has been cool | 18:28 |
crossbeau | seems really powerful | 18:28 |
*** crossbeau has quit IRC | 18:30 | |
*** terrylhowe has quit IRC | 18:37 | |
*** annegentle has quit IRC | 18:43 | |
*** terrylhowe has joined #openstack-api | 18:45 | |
*** Guest80179 has joined #openstack-api | 19:06 | |
*** e0ne is now known as e0ne_ | 19:14 | |
*** Guest80179 has quit IRC | 19:14 | |
*** e0ne_ is now known as e0ne | 19:15 | |
*** Apoorva has quit IRC | 20:03 | |
*** Apoorva has joined #openstack-api | 20:04 | |
*** e0ne has quit IRC | 20:35 | |
*** amit213 has quit IRC | 20:44 | |
*** amit213 has joined #openstack-api | 20:44 | |
*** amit213 has quit IRC | 20:44 | |
*** lucas-dinner has quit IRC | 21:14 | |
*** fifieldt has quit IRC | 21:39 | |
*** fifieldt has joined #openstack-api | 21:51 | |
*** dontalton has quit IRC | 22:37 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!