Part of fixing bug #995287
Syncs these two commits from oslo-incubator:
Support overriding oslo localedir too
Add a gettextutils.install() helper function
to get a new gettextutils.install() function which allows the default
localedir to be overwritten via an environment variable.
Note that gettextutils.install() must be called before any other cinder
modules are imported since some modules attempt to translate strings
at import time (e.g. in cinder.flags). This is broken and inefficient,
but fixing it involves adding something like sphinx's l_() function and
would be very invaisve.
Change-Id: I86562b3a65d371673bb21f7179eecc7602bc0775
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')
n無効な syslog ファシリティ
>>> gettext.install('cinder', unicode=1, localedir='/opt/stack/nova/cinder/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 Cinder, we have taken a shortcut to avoid having to call it
explicitly from each script and instead call it from cinder/__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 cinder code (indeed, if we wanted
to support this, Cinder 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
cinder.openstack and this in turn causes gettext.install('cinder') 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.
However, there's a bit of an annoying detail here - by default,
nosetests starts in the current directly and tries to import all modules
it finds to look for tests. Without the _() builtin installed, importing
some modules like cinder.flags will fail.
Since it only ever makes sense to load tests from the cinder/tests dir,
we can ask nose to do that by using the --tests argument via setup.cfg.
Note, this means that if you previously did this:
$> tox -- cinder.tests.foo cinder.tests.bar
then you must now do this:
$> tox -- --tests cinder.tests.foo,cinder.tests.bar
Change-Id: If4125d6bcbde63df95de129ac5c83b4a6d6f130a
logging needs to be setup properly before we try to log
something. Fixed one spot from logging->LOG
Fixes LP# 1161038
Change-Id: I87743cff9062e47c1d5e989c2c0c05c3921b65c7
Add uuid support to param2id() to allow commands including
cinder-manage volume delete to work with uuid style volumd ids
Fixes bug #1158409
Change-Id: I2d197320b61f44d1104ed0342a6b5b70f673468a
This patch updates all the files from oslo under
stable/grizzly but policy.py. policy.py is a high risk
change at this date and it has lots of changes since the
last time we updated it.
Fixes bug #1157126
Change-Id: I399a1cd8474f718ed5196def90d2fea546fb01f5
rtslib is AGPL, so cinder-rtstool is defacto AGPL by importing it.
Remove cinder-rtstool from the OpenStack repository.
Fixes bug #1157091
Change-Id: I30c9ee19d43107fa7f2e5e65d69049b8d69d2bdf
* Added tests for db api call volume_get_active_by_window called by the volume
usage audit report.
* Added new db api called snapshot_get_active_by_window & test it. This is
similar to the volume_get_active_by_window method but returns the snapshots
active the supplied time window.
* Integrate the above into the cinder-volume-usage-audit script to report on
all the active snapshots as well as volumes in the specified time frame.
Fixes: bug #1157110
Change-Id: I7597da20c62150a8f6c74cbfeec159f68064d2a6
Update oslo rpc libraries to capture changes, primarly motivated
by secret=True flag on password config options. Skipping broken,
invalid test case while working on correct fix.
Change-Id: Ibb979189b4a6215f307cb49e4a17070ffc7f0f51
Currently, IQNs of remote nova compute nodes must be specified in
cinder.conf for them to be added to LIO's ACLs for LUNs.
This change will handle this at volume-attach time instead.
Change-Id: I278ce737042b15bd4d100d331564c1377bac0c55
Changes:
- Added cinder-backup to scripts in setup.py
- Added service_name to backup manager __init__
- Switched backup manager to using oslo.config
- Modified cinder-backup to use ProcessLauncher
Fixes bug: 1131147
Change-Id: I9b02d64def4ee892e9cfde4b4bcd50e5f9f9b707
LIO requires iSCSI initiator IQNs to be specified in an ACL to be
allowed to connect to the target. Currently this is only done for
the IQN of the initiator on the cinder-volume node.
This patch allows setting lio_initiator_iqns in cinder.conf to
provide access to other nodes. (Remote Nova compute nodes.)
Change-Id: I7ddee542fcd3fba5b6f142ad15459c08cfedc9d2
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.
Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.
Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.
Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.
Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).
Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
There was a syntax error in a print statement in cinder-volume-usage-audit
which caused the script to crash.
Fixes LP bug #1130266
Change-Id: If4b0102ec5218fc8347f97041ac65f633111c26f
We no longer use FLAGS.logdir. This commit updates
cinder-manage to use the new FLAGS.log_dir option instead.
Fixes LP Bug #1130258.
Change-Id: Id5f1175ec83f0f0b677ab0d75b310fa054459319
* Added the service wrapper for multi binscripts
* Added a service_name to manager
* Added the configuration wrapper so the impls do not need
to know if they are accessing config values from a option
group or from the DEFAULT group
* Updated drivers to use the new configuration wrapper
* Added an example config set for multi backend
* Modified service to comply w/ common
* Added get_volume_stats to iscsi
* Added config for volume_backend_name
implements blueprint multi-volume-backends
Change-Id: Idb86ac5f1c06b9cd5061bef6a24f17727e9a58c1
This patch enables LIO as an iSCSI backend for Cinder, using
python-rtslib.
To enable, set "iscsi_helper = lioadm" in cinder.conf.
This requires python-rtslib 2.1.fb27, which is available from pip.
Implements blueprint lio-iscsi-support
DocImpact
Change-Id: Ifb23de65f26a40997afd6148a1d0be39bcc8d196
Import oslo-incubator's rootwrap, which contains all the new
features and bugfixes that were pushed to nova-rootwrap earlier
in this cycle, including logging support and path search.
Implements bp: cinder-common-rootwrap
Change-Id: I68cbb788a3dda58dc146933be190146607b48801
New cfg module abandons previous disable_interspersed_args() and
recommand to use add_subparsers from argparser module instead.
This patch pull cfg module from Oslo and update the affected
cinder-manage utils.
Change-Id: I8913fafb8fdb19b3fe0a695a70c8b1e8f59c1027
As a work-around to deal with bug 1075838, we modified
monkey_patch in the Cinder binaries. The root cause of the
issue is/was actually a bug in eventlet but this was a quick
work-around.
Since the change Change-Id: I69ba75136e32e95c6fdf108f0c4fe21a5e3bdbe6
to do this landed, the problem has also been addressed in Keystone.
So, let's revert this patch to get back the greenthread performance
that we may have lost with this change. For now, everything should
be addressed as long as we don't implement multi api worker in Cinder,
if we do and the evenlet fix hasn't been released we'll need to turn
the modification back on for bin/cinder-api.
Change-Id: Ie845bade85dbceacd91f15e082325602d9a79c74
Along with moving to pep8 1.3.3, we also want to standardize
on what we ignore. This patch get's us most of the way there
by setting the ignore list to:
N4,E125, E126, E711,E712.
Almost all changes made here are white-space/indentation changes.
The removal of Hacking N4 errors from the ignore list will
be handled in a seperate patch.
Change-Id: If45f156600485d23769449018590f60b4f69b0c5
Fix some ordering/pep8/hacking issues in preperation for re-enabling
full pep8/HACKING checks in tox.
Change-Id: I7151ac73d1ace5d98046580e6d1c6a1dcc6c4cef
The openssl popen call to verify the token returns an error code
of 2 when a file doesn't exist. Normally this is caught and the
relevant file is downloaded, but monkeypatching os causes this
error code to be eaten and cinder to return a 401. Note that this
is likely a race condition that depends on exactly when greenthreads
are switching that is causing the return code from Popen to get
overwritten.
It is possible that this is exposing an underlying bug in eventlet
but the workaround is simply to make sure that we don't monkeypatch
os.
Fixes bug 1075838
Change-Id: I69ba75136e32e95c6fdf108f0c4fe21a5e3bdbe6
The migration from volume ID to UUID neglected to update the provider_location
field on the volume. As a result the iqn and volume name no long match and
existing volumes are no longer able to be attached after an upgrade
(essex -> folsom and then nova-vol->cinder).
This patch adds a method to the volume driver that will check for the
mismatch of volume name in the iqn during service start up. If
detected it will update the provider_location field in the database
to include the new ID. Also it will create a symlink to the device backing
file that also has the correct naming convention.
Note: We don't disturb an connections that are currently attached.
For this case we add a check in manager.detach and do any provider_location
cleanup that's needed at that time. This ensures that connections
persist on restarts of tgtd and reboot.
Change-Id: I8224824b793c98a9767c5d8dd741d892be720c4f
Fixes: bug 1065702
Sync up with changes made in Nova, this adds information
about line continuation (PEP8), OpenStack capitalization,
and commit messages.
Change-Id: Id6637307411bcc7a3637ac514c4ec34e26481e0d
It seems many point in the internal API and openstack.common changed, but
this binary has been forgotten.
Also, context ie needed when using the notifier, so import it.
This fixes bug #1053502
Change-Id: I306b8671e7b0ed8c2ce2548a51a4c5e6393e13cb
Signed-off-by: Julien Danjou <julien@danjou.info>
Python ignores SIGPIPE on startup, because it prefers to check every
write and raise an IOError exception rather than taking the signal. Most
Unix subprocesses don't expect to work this way. This patch (adapted
from Colin Watson's post at http://tinyurl.com/2a7mzh5) sets SIGPIPE
back to the default action for cinder.utils.execute and cinder-rootwrap
created subprocesses.
Fixes bug 1053364
Change-Id: I4b3307bd2f0f5d0da529d8b7d80fabae28c57732
Cinder-manage migrate import only works from Nova/Folsom--->Cinder/Folsom
this change adds an explicit check of the nova migrate_version (133)
to make sure we have all of the volume id/uuid changes that are needed
to be compatable, and presents an error message if that's not the case.
Addresses bug #1052598
Change-Id: I7f32cf35e33320f4348b7bc44a8e92b5716b71d8
Updates bin/nova-manage and the solidfire driver with several
hacking compliance fixes.
Makes it so run_tests.sh -p runs clean again.
Change-Id: Iee675cae06acda6a585a77073e773651aab9d5a1
Renames clear_rabbit_queues and volume-usuage-audit binaries
so that they are prefixed with 'cinder-'.
As part of this change the clear_rabbit_queues binary was changed
to use dashes instead of underscores for consistency with the rest
of the cinder binaries.
Fixes LP Bug #1044386.
Change-Id: I7692a543cc67af2d342a64b84626de38c0a64f81
* Fixes bug 1039615
* Now that quotas are back we need to handle migration
of volume related quota data in the cinder-manage migrate helper
* Only resource types transferred are volumes and gigabytes
Change-Id: Idd9aab834612e929683491f47fa1e1861bdbd0d1
adding the volume notifications
added unit tests for notifications
added context for notify with rabbit
blueprint cinder-notifications
Change-Id: I5aef1e718eebb9a61e0670d524fcd5f438dee016
Helper cmds to transition from nova to cinder
Implements an import section in cinder-manage to transfer
applicable tables from local or remote Nova database into a
fresh Cinder database.
Also implements optional method to copy persistent target files.
Change-Id: I2e655e26c55f1986f3b1554726cead9e73ee9bd6
Align with recent changes in nova-rootwrap by marking the
root_helper option deprecated and introduce usage of the
rootwrap_config option instead. The root_helper option will still
fully be supported in Folsom, but will be removed in Grizzly.
Transition notes: you should replace:
root_helper=sudo cinder-rootwrap /etc/cinder/rootwrap.conf
by:
rootwrap_config=/etc/cinder/rootwrap.conf
Change-Id: I22a6d2bdee6ad2c5ad587ceec574cec4b2887f22
Port recent nova-rootwrap changes to cinder-rootwrap, including:
* Move filter definition from Python module to configuration files
* Fix tests execution on Fedora (bug 1027814)
* Remove executable bit on cinder/rootwrap files
This certainly needs a matching change to devstack to pass gating.
Change-Id: I963bc7890ba285ae515ea61bbd960bd2523f9061
- We are not using openstack.common.notifier just yet so handedit
openstack.common.log to use cinder.notifier now.
Change-Id: I9d912904c53a8ef5d90b4ab5792f5577701b6817