132 Commits

Author SHA1 Message Date
Julia Kreger
02d8fa1393 Ignore new errors until we're able to fix them
Since blocking the package doesn't seem to be a good
solution to unblock the gate, lets go ahead and ingore
the errors until we are able to fix the issues in the
code.

Change-Id: I72496493359fa11eb122368479ee1ae9b87d82f2
Story: #2001985
Task: #19603
2018-05-08 17:25:24 +00:00
Hironori Shiina
26694e0676 Install reno to venv for creating release note
Although reno was once moved from test-requirements to doc/requirement
for introducing the new TPI, it is also necessary for creating a
releasenote with 'tox -e venv'. This patch adds doc/requirements to
venv for installing reno.

Change-Id: Ic9c755ef98b71448457560c78ae69571d1f4bd00
2018-04-19 11:45:42 +09:00
John L. Villalovos
6b91ba21df Resolve pep8 E402 errors and no longer ignore E402
Fix the pep8 E402 (Module level import not at top of file) errors.

For the Alembic files move the definitions of 'revision' and
'down_revision' below the imports. This is now done in Alembic [1]

For other files fix as needed by moving the imports or lines before
the imports.

In a few cases add a "# noqa E402" to whitelist the issue.

[1] dc2aae0374

Change-Id: I48c96d5da0cb747b3ca3fceea9b4ffa85a9ebe22
2018-04-10 17:34:04 -07: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
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
Doug Hellmann
9143ec7baf add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I50af6344c8de6fae3602e6d0f5267623ce492dc9
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-26 11:56:56 +00:00
Zuul
4c24b9c9bd Merge "Move execution of 'tools/check-releasenotes.py' to pep8" 2018-03-02 14:16:27 +00:00
Zuul
c3cddf8cf4 Merge "tox.ini: flake8: Remove I202 from ignore list" 2018-03-02 14:16:19 +00:00
John L. Villalovos
fabcf1a402 Move execution of 'tools/check-releasenotes.py' to pep8
The 'releasenotes' gate job does not run our tox section. This allowed a
releasenote to land that had a filename in an incorrect format because
it was not created with 'reno new'.

Move the running of 'tools/check-releasenotes.py' to the pep8 section
and whitelist the releasenote that got merged.

Change-Id: Id5bd8e0cbc9186c89f682224088a8f23998d59c3
2018-03-02 12:20:27 +00:00
John L. Villalovos
843c773573 tox.ini: flake8: Remove I202 from ignore list
Remove I202 (Additional newline in a group of imports) from the ignore
list. I202 is a check from the flake8-import-order [1] package.

There was a note to remove this check once the tempest plugin was
removed. As the tempest plugin has been removed we can now remove the
exclusion of this check.

Update files which failed this test.

[1] https://github.com/PyCQA/flake8-import-order

Change-Id: I6018d5a90174b3d4b6b8d8e05cee1c1104ccfde9
2018-02-26 09:00:42 -08:00
zhangjl
46ee76aa46 Trivial: Remove the non ascii codes in tox.ini
Change-Id: I99fa32ac021c0951fba1d25236bab597073dd301
2018-02-26 06:03:07 +00:00
Dmitry Tantsur
708a69879c tox: stop validating locale files
They are autogenerated, and the updates are submitted automatically.
There is no much value in validating them. Also the recent translation
update https://review.openstack.org/#/c/542609/ removes the last pot
file and this validation starts failing.

Change-Id: I08a5c6acf4312df307aee4ba66f3d957191c8708
2018-02-15 10:29:21 +01:00
Jay Faulkner
49fabe6d7b Add API methods for [un]rescue
Adds API methods to support rescue and unrescue.

After rescuing a node, it will be left running a rescue ramdisk,
configured with the rescue_password, and listening with ssh on the
specified network interfaces.

Unrescuing a node will return the node to Active.

Change-Id: I3953ff0b1ca000f8ae83fb7b3c663f848a149345
Partial-bug: #1526449
Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
Co-Authored-By: Jesse J. Cook <jesse.j.cook@member.fsf.org>
Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com>
Co-Authored-By: Aparna <aparnavtce@gmail.com>
Co-Authored-By: Shivanand Tendulker <stendulker@gmail.com>
2018-01-26 18:27:10 +00:00
John L. Villalovos
701e3bf707 tox: Use the default version of Python 3 for tox tests
When running the tox tests, use the default version of Python 3. Instead
of having to update the Python 3 version as we move from
    py34 -> py35 -> py36 -> py37 -> py38

Just use the default version of Python 3 on the system.

This will not affect what gets run in the gate, as the version is
explicitly specified when it runs there. This is for developers who run
the tests locally.

Change-Id: Iab9cd250dafb42f775f50bec2c69eaa2daaab574
2017-12-11 08:12:59 -08:00
Vu Cong Tuan
b4949a0b54 Apply pep8 check to app.wsgi
Because app.wsgi should meet pep8 standards,
this patch apply pep8 check to app.wsgi.

Change-Id: Ia0fda2d84200eecc513c59ade8bafca391ca01b2
2017-11-28 15:25:04 +07:00
Vladyslav Drok
e0514cb85b Add I202 to flake ignore list
Pep8 job currently fails complaining about I202 in a bunch of
modules. This change fixes the genuine errors in the module
import order, and adds I202 to the skip list so that we don't
have to add noqa comments everywhere we can not satisfy the
check. After we split out the tempest plugin, we'll remove
I202 from the ignore list and add noqa comments in the places
where it will still be needed.

Change-Id: Ia170a41d35dea8c9eda2b36c907dbc518169a824
2017-10-25 14:32:52 +03:00
Pavlo Shchelokovskyy
ca14146e03 Migrate to stestr as unit tests runner
Recent update brought os-testr 1.0.0 that already uses stestr test
runner instead of testrepository.

This patch migrates those places using testrepository to using stestr.

Change-Id: I793617e042b38aea4cb177b51b6a7ba4a9268f3c
2017-09-22 08:56:34 +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
Jenkins
312313ee9c Merge "Build docs with Python 2 for now" 2017-09-06 10:31:16 +00:00
Dmitry Tantsur
ad97de009b Build docs with Python 2 for now
When Python 3.6 is used by default (the case for F26), the build fails:
TypeError: '<' not supported between instances of 'NoneType' and 'str'

It is reported as bug 1714025, let's use Python 2 until it's fixed.

Change-Id: I8c2ba5b587b2919a22ff1d0f078c511d90de0f91
Related-Bug: #1714025
2017-08-30 16:33:02 +02:00
John L. Villalovos
66ad38f7c9 tox.ini: Add 'py36' to the default envlist
Newer operating systems, like Fedora 26, ship with Python 3.6 now. So
they can do a Python 3 test, add 'py36' to the default envlist.

Change-Id: I9bbca0d18c346fe0cfcb9878cd35632dbd998fb0
2017-08-28 10:24:29 -07:00
Jenkins
598aa07f3c Merge "[doc-migration] Add configuration folder for documentation" 2017-08-02 22:26:46 +00:00
Madhuri Kumari
adcbd324af [doc-migration] Add configuration folder for documentation
This patch does the following:
* Adds a configuration folder to contain automated generated config
files for Ironic.
* Adds `oslo_config.sphinxconfiggen` to the extensions list.
* Adds `oslo_policy.sphinxpolicygen` to the extensions list.
* Adds ironic-policy-generator.conf

This is important for Ironic to be included in the list of services
on https://docs.openstack.org/pike/configuration/

Change-Id: I51a7204ce00be2588e427c1951e8be7dc7a22647
Closes-bug: #1706176
2017-08-02 13:14:23 +00:00
yushangbin
e3ac898961 Remove install-guide env which is no longer effective
The install-guide directory was moved to doc/source directory when
migrating docs.

Change-Id: I61f295e3ca771f38290e5b9814c1cda7659154fc
2017-08-01 10:27:07 +08:00
Sam Betts
aeb5306093 Move install guide into new doc/source/install location
Change-Id: I7d853142aaf794869466a1ba1bfaa82fd8851b7a
2017-07-05 12:16:37 +01:00
Vladyslav Drok
31b35c7b0a Remove times.dbm prior to test run
It is a long known issue that tests for py3 can not be run after the
tests for py2 were, unless times.dbm is removed.

Related-Bug: #1229445
Change-Id: I32b62e6d870364554ec20c1acce88fa59b85881d
2017-06-14 16:23:49 +00:00
John L. Villalovos
0616c7485c Enforce releasenotes file naming
Ensure that releasenotes file naming matches how 'reno new' creates
them.

Change-Id: I796f928995fce27ca871e26d8694c655a21d0861
2017-04-05 16:41:52 -07:00
John L. Villalovos
0363e15b7c flake8: Specify 'ironic' as name of app
Specify 'ironic' as the name of the application for the flake8-import-order
plugin. That way it knows that imports of ironic should come after external
libraries.

Change-Id: I3e6fb237b9846e8de1a071f3a659c23c44bc7f75
2017-03-16 07:20:35 -07:00
Jenkins
221ca96b76 Merge "Explicitly use python 2 for the unit-with-driver-libs tox target" 2017-03-01 12:11:25 +00: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
Dmitry Tantsur
8058716018 Explicitly use python 2 for the unit-with-driver-libs tox target
Tox in Fedora 25 uses python 3 by default, and UcsSdk is not compatible with it.

Change-Id: Ib67b771bf2277a858f2a621d652bfc3c9254058e
2017-02-15 16:01:43 +01:00
Jim Rollenhagen
03cd4c4291 Add a tox target for unit tests with driver libraries
We mock out driver libraries in unit tests if they are not installed,
which leads to a periodic break in unit tests when they are actually
installed in the environment. This is sometimes a real break and
sometimes just a bad test, but at any rate it slows down packagers
and actual users.

Add a new tox target that runs unit tests with these installed,
so that we can put something in CI and stop breaking this.

Partial-Bug: #1626106
Change-Id: I81ce147c8958bb89b316c3c28fc9bce172f93873
2017-02-10 14:06:38 +00:00
Cao Xuan Hoang
eaf4622886 Remove a py34 environment from tox
The gating on python 3.4 is restricted to <= Mitaka. This is due to
the change from Ubuntu Trusty to Xenial, where only python3.5 is
available. So we can drop py34 environment from tox.

Change-Id: I5e4ed5b4e8e90266813c047d6502d2e7f9b7eb59
2017-02-08 16:09:54 +07: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
Jenkins
8698c3e98a Merge "Have bashate run for entire project" 2016-10-06 17:48:07 +00:00
ChangBo Guo(gcb)
516f4341ff Enable DeprecationWarning in test environments
Many deprecations are triggered early (on imports, for example).
To make sure all DeprecationWarning messages are emitted we enable
them via the PYTHONWARNINGS environment variable.

Note: this copy from 1be35ff039d67c50866f2556ef847b048cbf3578

Change-Id: Iac2fc6fdbf9596209ab44fa2274bd66620043a49
2016-10-06 11:49:18 +00:00
John L. Villalovos
3cedd6f924 Have bashate run for entire project
Before bashate was only running on the devstack/ directory. Have it
now run on the entire project for *.sh files.

Fix issues detected by bashate.

Also check the files:
    devstack/files/hooks/qemu
    devstack/lib/ironic

These files were located by doing:
    $ find openstack/ironic/ -not \( -type d -name .?\* -prune \) \
      -type f -not -name '*.sh' | xargs file | grep -i "shell script"

Change-Id: I238b7ab650781143fe8231e01250ab56120ff94f
2016-09-27 11:19:33 -07: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
Vladyslav Drok
6e775b82f4 Use upper-constraints for all tox targets
The issue has been resolved by infra [0], so we can use upper
constraints for all targets.

[0]
http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: I5c0378bdc6ddb4f8d0a328f3e61092be6cd579ac
2016-08-15 14:27:15 +00:00
Devananda van der Veen
c7da7a6925 Add keystone policy support to Ironic
Implements more fine-grained policy support within our API service,
following the oslo policy-in-code spec, while maintaining compatibility
with the previous default policy.json file. An empty policy.json file is
included, along with a sample file listig all supported policy settings
and their default values.

A new tox target "genpolicy" has been added to ease automation of
sample policy file generation.

All calls to policy.enforce() have been replaced with with
policy.authorize() to avoid silent failures when a rule is undefined,
because enforce() does not raise() if the target rule does not exist.

  NOTE: policy.enforce() is not removed by this patch, but a deprecation
  warning will be logged if it this method is invoked.

Updates unit test coverage for the new authorize() method, as well as
more general unit test updates for some of the new rules.

Partial-bug: #1526752
Change-Id: Ie4398f840601d027e2fe209c17d854421687c7b7
2016-08-04 12:43:20 +00:00
Jay Faulkner
dac5aee05d Add py35 to tox environments
Since we're running python 3.5 tests now, we should also be
running thme when running all tests with just `tox`.

Change-Id: I6ec077878906fd48e9e4dc654c63da3dbc83173b
2016-07-15 20:58:47 +00:00
Lucas Alvares Gomes
7abfe28618 Add debug environment to tox
The oslo_debug_helper enables developers to use pdb for debugging the
unittests.

Ref: http://docs.openstack.org/developer/oslotest/features.html

Change-Id: I08d4c0fcb2e8015c02f5e9b9d4e9dff7f58d21ea
2016-06-03 17:09:22 +01:00
Lin Tan
773aa20a4a Make use of oslo-config-generator
oslo_config provide a utility for generating sample config files,
which provide more detail about opts, like Minimum/Maximum value
and Allowed values.
So drop Ironic's "generate_sample.sh" which was copied from
oslo-incubator long time ago.

Add a new entry point "ironic" under oslo.config.opts namespace to
explore config options to oslo-config-generator.

After this patch, new config options of Ironic code should register
with ironic/conf/opts.py. New external libraries should
register with tools/config/ironic-config-generator.conf

There is a bug #1554657 with oslo-config about deprecated_group.
This bug have impact of some configs from keystonemiddleware
and oslo.messaging in ironic.conf.sample
So currently, deprecated option should always add the deprecated_group
even it didn't alter the group, otherwise the deprecated group value will
be 'DEFAULT'.

Update etc/ironic/ironic.conf.sample via running 'tox -egenconfig'.

Closes-Bug: #1564195
Change-Id: If7721e98e69b6f54f1ee04a07477396b86583371
2016-05-25 11:59:13 +08:00
Devananda van der Veen
6e82b2118a Update the api-ref documentation for Root and Nodes
This updates the API root documentation, which was non-existent,
and the Node documentation significantly, replacing many of the samples
and adding more verbiage to each property.

It's not perfect, but this is vastly more correct than the current docs.

Change-Id: Iaeb1c80ac0655fc0d73fa495ed43e3c02b345495
2016-05-20 08:35:29 -07:00
Jim Rollenhagen
6fbf5c5516 Eliminate warnings about rm in api-ref build
This currently gives a warning about the 'rm' command not being
installed in the venv. Whitelist bash and run rm under bash (like we do
with other external commands) to squash this warning.

Closes-Bug: #1581778
Change-Id: Id26926ad7a75b94f0f57ea3c2083312c66663b34
2016-05-16 21:51:48 +00:00
Jim Rollenhagen
fa098f69e4 Migrate api-ref into our tree
Per this email[0], it's time to migrate our API docs into our tree.

This copies the sphinx extension from nova into our tree as well, which
will be later split into its own python module. At that time we can cut
over to the module and drop it from our tree.

The conf.py and the tox environment are also cribbed from nova.

[0] http://lists.openstack.org/pipermail/openstack-dev/2016-May/093765.html

Change-Id: I683cc4d6459d77c42951a06247b6f9ff8f8456bd
2016-05-03 21:39:42 +00:00
Alexey Galkin
76cacceb60 Fix tox cover command
Add testr-args and coverage in tox cover command

Change-Id: I69192c464a36b42d97559534d2df19f737d58407
Closes-bug: #1571366
2016-04-29 16:26:48 +03:00
Jim Rollenhagen
e27e7ed4a9 Make tox respect upper-constraints.txt
This will force pip install to use the upper-constraints.txt specified
version of pip modules. When you don't do this, you are out on the
bleeding edge and become unstable everytime some python library in the
wide world changes in a way that you don't expect.

Post jobs are not yet compatible with the upper-constraints file, so
override the install_command there to skip upper-constraints.

Blatantly cribbed from the equivalent trove patch:
https://review.openstack.org/#/c/298850

Change-Id: I73aa8cf37adc36db2c56a8f29ea165775a83dc7f
Closes-Bug: #1563038
2016-04-01 05:07:19 -07:00
Lucas Alvares Gomes
d85b9970ce Fix doc8's "duplicated target names" (D000) error
This patch is enabling the D000 error (duplicated target names) in doc8
and fixing the occurrences of this error in the docs.

Change-Id: Iac048d213e0571b99696ec708f5c07d6e1bebb19
2016-02-03 15:22:35 +00:00
Lucas Alvares Gomes
fc72b4d904 Enable doc8 style checker for *.rst files
This patch is enabling the doc8 style checker for the *.rst files in
Ironic.

Since this patch is just the first stab at enabling this new check two
errors are currently being ignored by doc8 because of the number of
occurrences in our docs:

* D000 - Duplicated target names. We do have many links with generic
         names scattered around the docs (e.g "see", "link")

* D001 - Line's too long

These errors will be fixed in a following patch.

Change-Id: I32fb5a3104b9773c55a80a84dd81e49c567c76ac
2016-02-02 12:38:20 +00:00