Commit Graph

7 Commits

Author SHA1 Message Date
Zuul 74313e9c76 Merge "Make inject_image_metadata use action wrapper" 2021-03-07 16:05:36 +00:00
Zuul ec9afd69b6 Merge "Fix nonsensical test mocks and assertions" 2021-03-07 10:32:12 +00:00
Abhishek Kekane d54449af44 Utilize newly added tasks database fields
Made provision to pass image_id, request_id and user_id information
while creating new task.

Partially-Implements: blueprint messages-api
Change-Id: I299a222eeef81431143db3ba7fc08365c924326b
2021-02-24 05:17:43 +00:00
Dan Smith 2e06864b2c Make inject_image_metadata use action wrapper
This makes the inject_image_metadata task use the ImportActionWrapper.
Because of the inbuilt rejection of internal os_glance_* property
manipulation, this also brings an operator-visible change to the
injection behavior. Specifically, os_glance_* keys can no longer be
injected via config (nor should they ever have been).

Change-Id: Ib1138ee2cd0383f14c710716f3c103a146b0c4dd
2021-02-10 07:36:24 -08:00
Dan Smith b1e757884a Fix nonsensical test mocks and assertions
The test_inject_image_metadata test was doing some completely
nonsensical mock behavior, like mocking something after we have
run the method under test, and re-mocking the image repo with the
thing that was supposed to change so that the assertions were not
even checking the actual behavior. None of the three tests were
actually testing the desired behavior.

In the case of the admin_user test, it was also asserting that things
were not run that *should* be, probably because the mocks were done
after the execution and asserting that they *were* run would never
work.

This also wires up the image and image_repo mocks that were in
setUp(), but unused (and incorrect) so that we can assert the calls
are actually as we expect.

Change-Id: Ifc2f49d49ff62c49c7dd1d2174a78bb1451b7bf3
2021-02-10 07:36:24 -08:00
Sean McGinnis 94b0876429 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I44e7b6f76e2d12f620ec602afc77ce11ba6b9d9a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-20 15:07:00 +00:00
Corey Bryant c58e5e02af Rename async package to async_
In Python 3.7, "async" is a keyword. To prevent it from
conflicting, rename the async package to async_.

Change-Id: I1eaf87eedb86679d9ca9323aac05f0770c33efea
Closes-Bug: #1781617
2018-08-07 14:42:14 -04:00