133 Commits

Author SHA1 Message Date
Surya Seetharaman
d693d4c06c Support power state change callbacks to nova using ksa_adapter
Add power state change callbacks of an instance to nova by
performing API requests. Whenever there is a change in the
power state of a physical instance (example a "power on"
or "power off" IPMI command is issued or the periodic
``_sync_power_states`` task detects a change in power state)
ironic will create and send a ``power-update`` external event
to nova using which nova will update the power state of the
instance in its database. By conveying the power state changes
to nova, ironic becomes the source of truth thus preventing
nova from forcing wrong power states on the instance during
the nova-ironic periodic sync. It also adds the possibility of
bringing up/down a physical instance through the ironic API
even if it was put down/up through the nova API.

Note that ironic only sends requests to nova if the target
power state is either "power on" or "power off". Other error
states will be ignored. In cases where the power state change
is originally coming from nova, the event will still be
created and sent to nova and on the nova side it will be a
no-op with a debug log saying the node is already powering on/off.

NOTE: Although an exclusive lock (task_manager.upgrade_lock()
method) is used when calling the nova API to send events,
there can still be a race condition if the nova-ironic power sync
happens to happen a nano-second before the power state change
event is received from ironic in which case the nova state will
be forced on the node.

Credit for introducing ksa adapter: Eric Fried <openstack@fried.cc>
Depends-On: https://review.opendev.org/#/c/645611/
Part of blueprint nova-support-instance-power-update
Story: 2004969
Task: 29424

Change-Id: I6d105524e1645d9a40dfeae2850c33cf2d110826
2019-08-12 19:29:57 +02:00
Zuul
adecc670f7 Merge "Incorporate bandit support in CI" 2019-06-19 05:45:10 +00:00
Kaifeng Wang
caf925349a Incorporate bandit support in CI
Change-Id: I0ffe0c12e9e32f32d2b400b5756fc2148a2993a0
Story: 2005791
Task: 33518
2019-06-10 09:26:04 +08:00
Ilya Etingof
234dea98bb Bump lower mock version to 3.0.0
Previously used mock 2.0.0 has a nasty bug which prevents mocking
`@staticmethod` callables [1][2].

1. https://github.com/testing-cabal/mock/blob/master/CHANGELOG.rst#300
2. https://bugs.python.org/issue23078

Change-Id: I38d78cb8de92e9ecfc3dda5ffafcb4ffe175169e
2019-06-04 17:05:01 +02:00
Kaifeng Wang
2eceb3c8ab Fix lower-constraints job
lower-constraints job is broken due to fail to install psycopg.

Spotted log:

http://logs.openstack.org/02/642402/6/check/openstack-tox-lower-constraints/ca317fe/job-output.txt.gz#_2019-03-14_01_51_01_006156

Add libpq-dev to the bindep and bump psycopg version to >= 2.7 as evidence
shows it has a bug to support PostgreSQL >= 10.0 [1]

[1] https://github.com/getredash/redash/pull/2111

Change-Id: I1d5f0dab41638be1df9d63ede267f5a6d9f8c566
2019-03-14 17:24:09 +08:00
Nguyen Van Trung
de6cfdb541 Fix stestr has no lower bound in test-requirements
This issue will occurs when they validate with test-requirements in
constraints.

issue logs:
  | ubuntu-xenial | Validating test-requirements.txt
  | ubuntu-xenial | Requirement for package stestr has no lower bound

Change-Id: I61a25bc6ccbc97006443db8f9086bec41506e940
2018-06-18 09:23:02 +07:00
Pavlo Shchelokovskyy
64a90a6700 Comply with PTI for Python testing
Project Testing Interface for Python [0] suggests to use stestr
as unit test runner uniformly across all OpenStack projects.

[0] https://governance.openstack.org/tc/reference/pti/python.html

Change-Id: I1c321500a2256b09cb6a58f6cd7070c9dc702555
2018-06-07 10:39:16 +03:00
Dao Cong Tien
580d4338e2 Check pep8 without ignoring D000
Currently, ironic ignores D000 check because of error:
"D000 Cannot analyze code. Pygments package not found."

Pygments is supported from:
https://review.openstack.org/#/c/568729/

Change-Id: Ib942f47abf6facaf9967603914326aa3cb79bbd9
2018-05-24 08:33:56 +07:00
ghanshyam
3f460ba927 Gate fix: Cap hacking to avoid gate failure
hacking is not capped in g-r and it is in
blacklist for requirement as hacking new version
can break the gate jobs.

Hacking can break gate jobs because of various
reasons:
- There might be new rule addition in hacking
- Some rules becomes default from non-default
- Updates in pycodestyle etc

That was the main reason it was not added in g-r
auto sync also. Most of the project maintained the
compatible and cap the hacking version in
test-requirements.txt and update to new version when
project is ready. Bumping new version might need code
fix also on project side depends on what new in that
version.

If project does not have cap the hacking version then,
there is possibility of gate failure whenever new hacking
version is released by QA team.

Example of such failure in recent release of hacking 1.1.0
- http://lists.openstack.org/pipermail/openstack-dev/2018-May/130282.html

Change-Id: I688a5f322bba52ae3b9fa5ecab5bed4f58fec542
2018-05-09 02:43:42 +00:00
John L. Villalovos
ca91d4d871 Remove pycodestyle version pin. Add E402 and W503 to ignore.
Rather than pinning pycodestyle, ignore the E402 and W503 error. Fix
issue with E731 (Do not assign a lambda expression, use a def).

W503 is something we will likely never enable as it is a personal
style decision and can change depending on the code. There is no one
right answer. Interestingly there is also a W504 which is the opposite
check.

E402 is one we should most likely fix. But it can be done in a follow
patch or patches.

List of various error codes:
https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes

Change-Id: Ie2c31a8a3c75beeef22453cab5878cf0094bdf3f
2018-04-10 16:48:26 -07:00
Jim Rollenhagen
fc15be6e32 Pin pycodestyle to <=2.3.1
2.4.0 broke our pep8 tests pretty hard:
http://logs.openstack.org/20/531320/14/check/openstack-tox-pep8/c9d9d10/job-output.txt.gz#_2018-04-10_15_43_40_014738

Pin pycodestyle until we have time to fix all of those.

Note that this is in the global-requirements blacklist to allow
projects to manage those versions on their own:
b94a4e8c8f/blacklist.txt (L13)

Change-Id: I6b0d458c702684779eb21e7022dd0f3193ac72d2
Story: 2001819
2018-04-10 21:23:46 +00:00
Nguyen Hai
7ba42e091d Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
[1] https://governance.openstack.org/tc/reference/project-testing-interface.html
[2] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

[doc/requirements.txt] & [test-requirements.txt]
To support documentation generation in new PTI, project should have
list python dependencies needed for documentation in
doc/requirements.txt which are move from test-requirements.txt

[doc/source/contributor/index.rst] & [setup.cfg]
- Remove [pbr] section in setup.cfg [3], and unrelated lines in
contributor/index.rst
[3] http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html
- Add sphinxcontrib.apidoc to replace pbr autodoc

[tox.ini]
--ignore D000: pep8 require sphinx (which move to doc/requirements.txt)
to test doc/source files, however, docs already test the doc/source.
Therefore we can ignore the D000 error code.

Depends-On: https://review.openstack.org/#/c/559327/
Change-Id: Iee90f19a5e46978a97035eab7e4b1e0ec68b8684
2018-04-06 14:33:47 +00:00
OpenStack Proposal Bot
30a557ff07 Updated from global requirements
Change-Id: I4c7930477e058a09ad90c8697b8f4b5e2c0447ad
2018-03-15 07:00:04 +00:00
OpenStack Proposal Bot
6bb5bd7e43 Updated from global requirements
Change-Id: Id95f7b7baa9099653da2c5414661995cc22eb13c
2018-03-13 06:54:40 +00:00
OpenStack Proposal Bot
0ce6bce9e5 Updated from global requirements
Change-Id: I76719f244c1a5cf34afa0f8c967df231fc72792f
2018-03-10 13:15:06 +00:00
OpenStack Proposal Bot
c2b6611ddf Updated from global requirements
Change-Id: I9c7368b19c3774746c9562d52876021baac2e880
2018-01-24 00:55:27 +00:00
OpenStack Proposal Bot
0aae151a30 Updated from global requirements
Change-Id: I150316afff013a6c114992daf67cdc612f85251b
2018-01-17 20:35:20 +00:00
OpenStack Proposal Bot
4a6671b8d1 Updated from global requirements
Change-Id: I2f86b636737ffce95f1f2e1e026e8834bd8e42b4
2017-11-16 11:05:33 +00:00
Pavlo Shchelokovskyy
0e4b5b8c05 Cleanup test-requirements
- python-subunit is not used directly anywhere
  and it is dependency of both testrepository and os-testr
  (probably was used by some tox wrapper script before)

- python-ironicclient is not used anywhere
  (probably should've been used by functional tests,
  but we still have none of those).

Change-Id: I42aeb75dab18d90d60792f070599532fd3d9af10
2017-09-25 06:30:33 +00:00
OpenStack Proposal Bot
7f4275959a Updated from global requirements
Change-Id: I36ee4f2127fd7fef0d81e2efa69a717369472968
2017-09-16 23:12:57 +00:00
OpenStack Proposal Bot
80161f1751 Updated from global requirements
Change-Id: I062934f70d84ee50d90a0ec189487a0f2ecb29bc
2017-09-13 23:57:46 +00:00
OpenStack Proposal Bot
8a8fcdc216 Updated from global requirements
Change-Id: Ic85c561d0998cc7c5027119236a2368acf1ed0fb
2017-09-12 04:15:47 +00:00
John L. Villalovos
3700e7c6d5 flake8: Enable some off-by-default checks
Update test-requirements.txt to use latest versions of:
    * flake8-import-order
    * hacking

Enable the following off-by-default checks:
    * [H204] Use assert(Not)Equal to check for equality.
    * [H205] Use assert(Greater|Less)(Equal) for comparison.

Fix code that failed H204 and H205. In this case the fix was to add:
  # noqa

As we want to ensure that these particular tests are calling the
desired comparison operators.

Change-Id: If9cba62c832e301ac81320f9142e91319f0e40a9
2017-09-07 13:21:30 -07:00
OpenStack Proposal Bot
b8d4b55942 Updated from global requirements
Change-Id: I1c708b4dfeb1cf62635ea28386866e5e1fea3a42
2017-08-22 11:46:38 +00:00
OpenStack Proposal Bot
9ffc9eb548 Updated from global requirements
Change-Id: I54fdba274c2fa5bfa76d87b4a478e8eb40e9d355
2017-07-29 21:44:33 +00:00
OpenStack Proposal Bot
daf01d854c Updated from global requirements
Change-Id: Ie86268aa40e0604c92d6997604ebf9d30e66a68d
2017-07-14 15:40:59 +00:00
Sam Betts
31ac1b72f2 switch from oslosphinx to openstackdocstheme
Change-Id: I2f1f8f76b6ec732a770707a259dc72a2f576e46c
2017-07-04 15:32:27 +01:00
OpenStack Proposal Bot
b7d3824f41 Updated from global requirements
Change-Id: I905b2d66634cb0474cd5f56ca427290c423cf8a9
2017-06-27 17:43:38 +00:00
OpenStack Proposal Bot
897e1b6851 Updated from global requirements
Change-Id: I396af4a4620683a07121b908dbe645233cff8432
2017-06-05 21:49:05 +00:00
OpenStack Proposal Bot
4768052c4f Updated from global requirements
Change-Id: Iab43081437b0df77de7c284d3000476d068c0561
2017-05-18 21:31:04 +00:00
OpenStack Proposal Bot
20dba3fb88 Updated from global requirements
Change-Id: I661a08ce6d9cc94b9cd6905777b9dad1d92bd14c
2017-05-16 12:20:42 +00:00
OpenStack Proposal Bot
a5fb9ae50a Updated from global requirements
Change-Id: I539741ad2499a62cb2baa00f654ed377bd1fe4e1
2017-04-07 06:05:15 +00:00
OpenStack Proposal Bot
b613a3ccce Updated from global requirements
Change-Id: I244a1d6f66d61a8185ff930f0ccf73fdcaaf105a
2017-03-23 22:49:30 +00:00
ricolin
3229ad1dcf Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: I635dbf199bad59c72401a4de1de5200132746f6f
2017-03-02 16:58:48 +08:00
John L. Villalovos
d0a2e13f10 Use flake8-import-order
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.

Change-Id: I821fd7467f6c5cc1487149297f26e4ad539cf25d
2017-02-16 09:35:28 -08:00
OpenStack Proposal Bot
44817b9a61 Updated from global requirements
Change-Id: I7d91c3cf6de8245ec417f0ae24cb709f64250eb9
2017-02-14 05:51:48 +00:00
OpenStack Proposal Bot
5bb3adf16b Updated from global requirements
Change-Id: I3271bb35e005003656526a0406a6c3359ac71975
2017-01-27 02:07:00 +00:00
OpenStack Proposal Bot
1f2e743f99 Updated from global requirements
Change-Id: I45fe35000c7f901315788d93cde80b86bb93d4aa
2017-01-20 13:47:22 +00:00
OpenStack Proposal Bot
9012f52e13 Updated from global requirements
Change-Id: I2e0528385d8cda29834e4aee0cf2d493f953d559
2017-01-15 09:21:12 +00:00
OpenStack Proposal Bot
557469b5b7 Updated from global requirements
Change-Id: I8eaceec4a9e54529d336d4f8c322e1867dd41bfd
2016-12-23 12:58:42 +00:00
OpenStack Proposal Bot
e299ef2246 Updated from global requirements
Change-Id: Ie2e6965931186692fd40e41485b353c479a76b4d
2016-11-15 19:50:32 +00:00
John L. Villalovos
8b6894483b Update to hacking 0.12.0 and use new checks
Use hacking 0.12.0

Use the new checks that are available:
    [H106] Don’t put vim configuration in source files.
    [H203] Use assertIs(Not)None to check for None.
    [H904] Delay string interpolations at logging calls.

Fix code so tests pass.

Change-Id: I902e999687b066800e18fafd091571bf718b15f4
Depends-On: I2aa44b62f900d4dfd67701b01eadd0523fbfaf07
2016-11-08 11:57:15 -08:00
OpenStack Proposal Bot
6893d23cd7 Updated from global requirements
Change-Id: I38787c559632c19fad3e61c9ee4a3ae8646e1c6c
2016-11-02 21:53:43 +00:00
OpenStack Proposal Bot
0831698493 Updated from global requirements
Change-Id: I6038470839de526e71db0b0df7e17092ea9476f1
2016-10-22 01:19:46 +00:00
OpenStack Proposal Bot
9d068c85cb Updated from global requirements
Change-Id: I1178b5193694c8afec1c655aa7609c9f78fee793
2016-09-30 23:21:04 +00:00
Jay Faulkner
4da03e0faf Add a basic install guide
This installs the basic directories and content pointing to the current
Ironic Installation Guide. Simply having this in our repo will not lead
to it being published, this is only the first step. Having these items
in our repository is a good first step to building out our install
guide.

Change-Id: I6a0e69bd3b6f5074ae61505f82f27bcf9df84bab
Partial-bug: #1612278
2016-09-07 08:40:48 -04:00
OpenStack Proposal Bot
739355c091 Updated from global requirements
Change-Id: I46a60d1064a4304b704df0496d59cce25a12c4b1
2016-09-01 11:04:58 +00:00
OpenStack Proposal Bot
a5cec645b3 Updated from global requirements
Change-Id: I13298cf6f1939f1bf67342a826c26f50f18123f4
2016-08-26 22:06:57 +00:00
John L. Villalovos
b3be30bad1 Update hacking test-requirement
Update the hacking test-requirement to match openstack/requirements
global-requirements.txt

Remove author lines from some files to fix error:
    [H105] Don't use author tags. As we use version control instead

The hacking requirement is not updated by the proposal bot.

Change-Id: I8a35a7ebd811c477c893c7b5e854c46acc075af0
2016-08-23 13:25:47 -07:00
OpenStack Proposal Bot
2f94f9eb85 Updated from global requirements
Change-Id: Ibf40a95bb193c74acd1c2e320d7b27876b37b308
2016-08-09 10:25:15 +00:00