[openstack-dev] [Nova] Broken nova-lxd

ChangBo Guo glongwave at gmail.com
Fri Jul 28 02:55:53 UTC 2017


For the specific case with method "last_bytes",  it's also used  in other
projects [1], an alternative solution is that add this method in
oslo.utils.fileutils, then consume it from oslo.

[1] http://codesearch.openstack.org/?q=last_bytes&i=nope&files=&repos=

2017-07-28 6:57 GMT+08:00 Michael Still <mikal at stillhq.com>:

> Hi,
>
> 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.
>
> 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.
>
> 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.
>
> Michael
>
>
>
>
> On Thu, Jul 27, 2017 at 11:25 PM, Kharkov Alexander <
> kharkovalexander at gmail.com> wrote:
>
>> Hi, Michael
>> 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.
>> Your commit and review links below:
>> https://git.openstack.org/cgit/openstack/nova/commit/?id=234
>> 1a41eaee5152e95379e5ed38012270af82ef5
>> https://review.openstack.org/#/c/472228/9
>> ...
>> Failed nova-lxd
>> ...
>>
>> Failed 1 tests - output below:
>>
>> ==============================
>>
>>
>> test_driver.LXDDriverTest.test_get_console_output
>>
>> -------------------------------------------------
>>
>>
>> Captured traceback:
>>
>> ~~~~~~~~~~~~~~~~~~~
>>
>>     b'Traceback (most recent call last):'
>>
>>     b'  File "/home/ubuntu/nova-lxd/.tox/py35/lib/python3.5/site-packages/mock/mock.py",
>> line 1305, in patched'
>>
>>     b'    return func(*args, **keywargs)'
>>
>>     b'  File "/home/ubuntu/nova-lxd/nova/tests/unit/virt/lxd/test_driver.py",
>> line 604, in test_get_console_output'
>>
>>     b'    contents = lxd_driver.get_console_output(context, instance)'
>>
>>     b'  File "/home/ubuntu/nova-lxd/nova/virt/lxd/driver.py", line 594,
>> in get_console_output'
>>
>>     b'    log_data, _ = utils.last_bytes(f, MAX_CONSOLE_BYTES)'
>>
>>     b"AttributeError: module 'nova.utils' has no attribute 'last_bytes'"
>>
>>     b''
>>
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
ChangBo Guo(gcb)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170728/40da6e6a/attachment-0001.html>


More information about the OpenStack-dev mailing list