Updates the generate_samples.sh script so that we remove
.pyc files in the nova source tree before generating the sample file.
If you don't run unit tests the .pyc files won't get regenerated.
This can cause cryptic errors if you run tests, switch branches,
and then try to regenerate your config files if there are module
differences, etc.
Change-Id: I784a22c1cd7fb2c69ea1d9e02f87bd7da19d76aa
See I62ce43a330d7ae94eda4c7498782a655e63747fa for the gorey details on
why this exists.
As of this fix:
https://github.com/eventlet/eventlet/pull/34
which was released in eventlet 0.13, we no longer need the patch.
This has now been removed from oslo-incubator, so this is really just
syncing that removal.
Change-Id: I84267f3c6726cb2e750f615e107c48b12c6ed353
This is for Python 3 compatibility, since Python 3 does not support
the print statement, only the print function. (Python 2.6 and 2.7
support both, depending on whether a __future__ import is used.)
Paths containing "xen" were left alone, because of comments in a
couple of the files indicating that the XenServer code needed to be
compatible with Python 2.4.
Fixes bug 1226943
Change-Id: I23b804a4d99500b4acf81dd19645ab06dfcc9f1c
This patch reverts 13d80020. The help message should be added
in oslo-incubator since generate_sample.sh is synced from there also.
Resolves bug #1204204
9f2b93b Sample config file generator clean up
33f9f78 Replaces relative path to absolute path in conf file generator
c97e17b Refactors if statement in config generator
8b11fda Provide useful defaults for config generator
4c02e0a Unset OS_xx variable before generate configuration
Change-Id: I96fcb39c0c620c147fea5c96416e506a758619ce
Needed to make run_tests.sh identify requirements correctly
We need to check requirements.txt and test-requirements.txt
in parallel to ensure both are satisfied and we don't upgrade
a package beyond requirements.txt's limits when installing
dependencies for test-requirements.txt
Fixes bug: 1227019
Change-Id: I606f8a1d3eed5c270d5b3c154994d5c3a17b98c8
This just adds a sample command line for how to generate the
nova.conf.sample because I keep forgetting how to do it.
Change-Id: Id8bfb859f90d7fde51dd1ffdb40ec383ed5193e6
The sample command line lacks the arguments required for executing
the script. Added the command line used in check_uptodate.sh
Fixes bug #1204204
Change-Id: I475491872577632c472695a3b1089caaf1f27d7c
Previous _ was monkey patched into builtins whenever
certain modules were imported. This removes that and
simply imports it when it is needed.
Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
First time run of the console rotate script failed, due to the fact that
the logs did not exist at that time.
Fixes bug 1204440
Change-Id: I49b5569c1ba3349d911caace42685fa0f19a1f66
The sample generator tool in Oslo is located in tools/config therefore
this patch moves the files in tools/conf to tools/config. The reason
Oslo chose 'config' is because the generator.py module is located in
the openstack.common.config package and update.py looks for the
corresponding directory in tools when it syncs the 'config' package.
./update.sh --module config --base nova --dest-dir $NOVA_HOME --nodep
Since every thing moved to tools/config, changes had to happen on
the tox.ini file and check_update.sh
Change-Id: Icbd467888cc7f16fa3694ed2b93548d0285461b5
We added this check recently to Ceilometer, and it helps a lot to keep this
file always up to date and not falling behind.
Change-Id: I5ad2c6366032a39c2e55dd11a16b9f1780ab9ed0
Includes these commits:
3948aee Highlighting the deprecated nature of 'log-format'.
b21fc56 Fix bad default for show_deleted
d28fa69 python3: Add python3 compatibility.
0bf03b7 Add network_utils.urlsplit
e456727 Remove useless logging in networks_utils
7119e29 Enable hacking H404 test.
b41862d Use param keyword for docstrings
2f01388 Use Python 3.x compatible except construct
e3545f8 Enable hacking H402 test
484a1df Enable hacking H403 test
35660da Enable hacking H401 test
874249e Add support for requirements.txt.
b135234 Remove the notifier and its dependencies from log.py
926b3e9 Fixes import order nits
Changes which may look not look so harmless:
- the common get_admin_context() method is not used by Nova
- network_utils.urlsplit() is added but not used yet
- suppport for requirements.txt is added to patch_tox_venv but
actually it doesn't use those files
Change-Id: I03e67f4648dcaf57620f11e63cfd8e7dbe3665cb
We already mostly use:
from nova import db
instead of:
import nova.db.api
So change remaining few cases to use nova.db instead of nova.db.api.
Help make code more uniform and easy to work with.
Change-Id: I6183352c4bbe77b88a5b277788f588b0b48c6476
Xen will produce the guest logs in a specified directory.
This scripts configures the above logging as expected
by the xapi plugin nova uses to read the logs.
In addition it ensures that any log that grows bigger
than 1MB will be truncated down to 5KB.
Ensuring the log directory is inside a loop back device
of a restricted size, and running this script every
minute using cron, will stop guests from using up
too much Dom0 disk space, and taking out the hypervisor
Part of blueprint xenapi-server-log
Change-Id: I4caa82f4d0620d924e37e3b605cf62b4d5b73570
Optimized grep calls to not create a grep process per file.
Defined variables to enhance readability.
Change-Id: Ic873f2c3b600a737ce54444dec973720c8813285
When there's 2 options with the same name, the script gets confused and
doesn't know in which group it goes. This fixes it, and fixes also the
template generation which is broken for various reasons:
- gettext.install was missing
- nova-rootwrap when imported calls exit() because it doesn't find a valid
configuration file, so let's exclude it entirely anyway
- eventlet/greendns needs to be ignored for this
Change-Id: Iaa4e9a806e79032ce1675b46a6b7a7628c3eff89
Signed-off-by: Julien Danjou <julien@danjou.info>
analyze_opts is a tool to help clean out a nova.conf file by checking
for unused and default values set in your nova.conf
Change-Id: I01fff134f8906bff929c55bea8c152653d3e9760
Mechanical translation of the deprecated
except x,y: construct with except x as y:
The latter works with any Python >= 2.6.
Add Hacking check.
Change-Id: I845829d97d379c1cd9b3a77e7e5786586f263b64
The dynamic nature of our object model is going to cause lots of
heartache for pylint, especially in the actual definitions. This
just excludes that whole directory from pylint's view, which will
limit the heartache to only everywhere objects are actually used.
Related to blueprint unified-object-model
Change-Id: I7f1a4b10b8a5098aab2ab2e8ea5da15ec43f0e2e
This failure in colorizier was hidding the actual error
in the tests. If we ran enough tests it also became difficult
to see which test had actually failed.
Fixes: bug 1183602
Change-Id: I806da8f13040b38258de7f3e0fa7b62700bdcead
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.
Change-Id: I68ece8406fb1d4e082a42db8e76e17b1aaa7e775
Fixes: bug #1179008
Fixes bug 1182271.
* tools/pip-requires: The requests library released 1.2.1 today
which brings in sphinx as a new dependency. One of sphinx's
transitive dependencies is on a newer version of jinja than is
provided in the python-jinja2 package on CentOS 6, and since nova's
unit tests allow site-packages in the venv for libvirt support this
cap is needed so that gate-nova-python26 will continue to work.
Because requests is actually a dependency of python-cinderclient but
is only breaking nova's unit tests, it has to be added and come
before python-cinderclient in the pip-requires list. A separate
change has been proposed to openstack/requirements which will need
to merge first. https://review.openstack.org/29850
Change-Id: Ia198192d6231f71272d3aa4f5942828a45d86ceb
Remove a bunch of local custom scripts. Replace with configurable
external tools.
Use local hacking checks for nova specifics.
Change-Id: I75a01375ba0ec36d2ff05abc47abe0a3f225eda5
Sync some trivial Python 3 compatibility and pep8 improvements from oslo.
I just want to have this in sync so that pulling in a feature I'm working
on comes in without unrelated changes
Change-Id: I13fcb0bd538a153b90acf0b18497e335a64dc9d1
Declarative approach to packaging, obviates the need for copying files.
Also, removes the need for setup.py to import files from the nova
module.
./run_tests.sh now ensure's that nova.egg-info/entry_points.txt is up to
date before running tests.
Change-Id: I7b7a18e065a62491ade54fbed5d8400db1d4e6c7
Just changes openstack.common to use the new print statements.
This is in preparation for another sync coming shortly for the
scheduler library.
Change-Id: I17a86ef87f3253d6bb756cbd40a3ff5df9be23ff
These are all minor changes bringing nova up to commit
90e83530d4dc49d570fa05ea63a93805717dcfa0 in oslo-incubator.
Change-Id: I0291eed31b1e650da211fe2a8b65fad0c35c9053
The existing code only set `other_config` on a VDI when it was created using
`create_vdi`. This patch updates the code so that `other_config` is also set
when a VDI is created from a dom0 plugin or during a migration.
Also included is a one-time script to set the other_config for existing
VDIs that were affected by this bug.
Fixes bug 1162029
Change-Id: I4fa856754487f77ce9c8e39d45eee7ea5187123e
Tests in oslo-incubator now need the horrendous hack to workaround an
issue with eventlet on RHEL6. We've moved the patch_tox_venv tool
and redhat-eventlet.patch into oslo-incubator, so add them to
openstack-common.conf.
Change-Id: I1acfec282b64d7582144b155119bedb1741db2f7
Ran the oslo-incubator sync script and brought across only the files
that have small and safe changes.
Change-Id: I41b400c189e52a2e7f642a03ad143d821aaa807c
importing some nova modules expects _() to be defined, so lets define it
before we start importing them.
Change-Id: I7f951a24c19a53434c090cd2c01eded77c703943
* Clean up to support pydoc
* Support -h
* Make it actually work
* Improve docstrings
* Add copyright
Change-Id: I977df71e8213e39e9eebf9cc56b2dd7625959870
A number of places tried to use undefined names. This included one
powervm test which turned out to not check anything at all (used
fake implementation of tested method) and needed to be moved.
Make sure that this class of errors causes run_pep8 failure in the
future.
Change-Id: I82ccb63bbc6f6d2b20ecb7f06b2fc22f8f034a33
As part of the move of plugins to entrypoints, take advantage of the
entrypoints based console scripts, which will make our command line scripts
available for unittesting.
Part of blueprint entrypoints-plugins
Co-authored-by: Michael Still <mikal@stillhq.com>
Change-Id: I5f17348b7b3cc896c92263dd518abb128757d81f
The gettext.install() function installs a builtin _() function which
translates a string in the translation domain supplied to the install()
function. If gettext.install() is called multiple times, it's the last
call to the function which wins and the last supplied translation domain
which is used e.g.
>>> import os
>>> os.environ['LANG'] = 'ja.UTF-8'
>>> import gettext
>>> gettext.install('keystone', unicode=1, localedir='/opt/stack/keystone/keystone/locale')
>>> print _('Invalid syslog facility')
無効な syslog ファシリティ
>>> gettext.install('nova', unicode=1, localedir='/opt/stack/nova/nova/locale')
>>> print _('Invalid syslog facility')
Invalid syslog facility
Usually this function is called early on in a toplevel script and we
assume that no other code will call it and override the installed _().
However, in Nova, we have taken a shortcut to avoid having to call it
explicitly from each script and instead call it from nova/__init__.py.
This shortcut would be perfectly fine if we were absolutely sure that
nova modules would never be imported from another program. It's probably
quite incorrect for a program to use nova code (indeed, if we wanted to
support this, Nova code shouldn't use the default _() function) but
nevertheless there are some corner cases where it happens. For example,
the keystoneclient auth_token middleware tries to import cfg from
nova.openstack.common and this in turn causes gettext.install('nova')
in other projects like glance or quantum.
To avoid any doubt here, let's just rip out the shortcut and always
call gettext.install() from the top-level script.
Change-Id: If4125d6bcbde63df95de129ac5c83b4a6d6f130a