<div dir="ltr">Hi,<div><br></div><div>I'm cc'ing openstack-dev because your email is the same as the comment you made on the relevant review, and I think getting visibility with the wider Nova team is a good idea.<br><div><br></div><div>Unfortunately this is a risk of having an out of tree Nova driver, which has never been the recommended path for implementing drivers for Nova. Being out of tree isn't forbidden, but it does come with the cost of staying up to date with Nova and handling changes as they occur.</div><div><br></div><div>In this case, if you look at the review chain you'll see that the move is a pre-cursor to moving this code to use oslo.privsep. Unless lxd is going to move to privsep in lockstep with nova, your best bet would be to duplicate this utility method in the nova-lxd codebase.</div><div><br></div><div>Michael</div><div><br></div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 27, 2017 at 11:25 PM, Kharkov Alexander <span dir="ltr"><<a href="mailto:kharkovalexander@gmail.com" target="_blank">kharkovalexander@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, Michael<div>I recently found that you commit to nova break nova-lxd driver functionality because it utilizes last_bytes function from nova/utils.py which you recently move to libvirt. Could you please confirm that it was not expected and suggest a fix? I'm currently working on nova-lxd now and want to have functioning unit tests to pull my changes for review.</div><div>Your commit and review links below:</div><div><a href="https://git.openstack.org/cgit/openstack/nova/commit/?id=2341a41eaee5152e95379e5ed38012270af82ef5" target="_blank">https://git.openstack.org/<wbr>cgit/openstack/nova/commit/?<wbr>id=<wbr>2341a41eaee5152e95379e5ed38012<wbr>270af82ef5</a><br></div><div><a href="https://review.openstack.org/#/c/472228/9" target="_blank">https://review.openstack.org/#<wbr>/c/472228/9</a><br></div><div>...</div><div>Failed nova-lxd</div><div>...</div><div><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(255,255,255);background-color:rgb(0,0,0)">Failed</span><span style="font-variant-ligatures:no-common-ligatures"> 1 tests - output below:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">==============================</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">test_driver.LXDDriverTest.<wbr>test_get_console_output</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">------------------------------<wbr>-------------------</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Captured traceback:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">~~~~~~~~~~~~~~~~~~~</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'Traceback (most recent call last):'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'  File "/home/ubuntu/nova-lxd/.tox/<wbr>py35/lib/python3.5/site-<wbr>packages/mock/mock.py", line 1305, in patched'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'    return func(*args, **keywargs)'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'  File "/home/ubuntu/nova-lxd/nova/<wbr>tests/unit/virt/lxd/test_<wbr>driver.py", line 604, in test_get_console_output'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'    contents = lxd_driver.get_console_output(<wbr>context, instance)'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'  File "/home/ubuntu/nova-lxd/nova/<wbr>virt/lxd/driver.py", line 594, in get_console_output'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b'    log_data, _ = utils.last_bytes(f, MAX_CONSOLE_BYTES)'</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b"AttributeError: module 'nova.utils' has no attribute 'last_bytes'"</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    b''</span></p></div></div>
</blockquote></div><br></div></div></div></div>