Closed bdlamprecht closed 6 years ago
With the changes made on branch py3
, the functionality works when following along with your tutorial. I haven't had the chance yet to fully test everything else out yet and not sure when I'll get to do that.
I installed it in my virtualenv
with this command:
pip install -e git+http://github.com/jeremyschulman/halutz.git@py3#egg=halutz
The only difference I noticed was in the call for body.keys()
(step [8]
in the tutorial, step [7]
in my reproduction) is formatted differently and not, in my opinion, as cleanly (my screenshot below):
I'm not sure if that is an inherit difference between py2
and py3
, but thought I would mention it.
Again, this is just a cosmetic issue, not a functionality problem and if you feel comfortable merging it as it currently stands, I'd be okay with that.
Thanks again for making the necessary changes so quickly.
@bdlamprecht - ah, re showing the ".keys()" - this is indeed a function of Py3 vs. Py2. You can get the same "effect" by doing using list()
on the body. For example:
In [6]: list(rqst.body)
Out[6]:
['bound_to',
'description',
'virtual_gateway_ipv4',
'vn_id',
'virtual_mac',
'label',
'l3_connectivity',
'svi_ips',
'ipv4_subnet',
'vn_type',
'endpoints',
'dhcp_service']
Yeah, not real familiar with all of the differences between py2
and py3
, but your example above works for me.
FYI, the variables you used in the tutorial are different than the ones you used above, so for my reference only, it should be the following:
In [7]: list(body.keys())
Out [7]:
['group',
'site',
'vid',
'tenant',
'status',
'role',
'custom_fields',
'name',
'description']
Again, thanks a bunch!
This is just for reference as the issue was discussed via a DM in the Slack channel NetworkToCode. There are no changes to what occurred in that conversation. The only additional information I'm including here is the full traceback I encountered.
When using
python3
injupyter notebook
and following your YouTube video, the following error is seen in step[5]
and[6]
:When the same steps are done using
python2
, this error does NOT occur.No rush on solving this, I'm good with using this workaround for now. Much appreciated. :smile: