<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The unit test for the network/v2/fakes.py for the port creates empty dictionaries e.g. for allowed_address_pairs:<br>
         port_attrs = {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">             'admin_state_up': True,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">            'allowed_address_pairs': [{}],<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">             'binding:host_id': 'binding-host-id-' + uuid.uuid4().hex,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">             'binding:profile': {},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">In practice this value is actually “none” if someone (or nova for that matter) creates the port without specifying anything.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">This allowed for at least one bug I hit, which will traceback with 'NoneType' object is not iterable:<br>
<a href="https://review.openstack.org/#/c/461354/">https://review.openstack.org/#/c/461354/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I wonder how the unit tests should be modified to actually catch these things?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I can modify fakes.py to exclude the 'allowed_address_pairs': [{}]
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">However these issues might be in more places so it might require a more generic approach.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">What is the opinion on this?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Note that:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">- I did not test against trunk neutron so maybe trunk behavior is different in always returning an empty dict ?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">- neutron cli used to work without this issue<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thx,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Robert van Leeuwen<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</body>
</html>