Patrick East [Fri, 21 Nov 2014 16:39:45 +0000 (08:39 -0800)]
Fixup regressions in PureISCSIDriver log statements.
There were some conflicting patches that went in to fix i18n helpers,
and in the merge resolution we lost some changes that previously removed
all uses of .format() from the driver. This puts back in the updated
log statements originally added in
https://review.openstack.org/#/c/135047/
In file "image_utils.py", "tmp" variable initialized in try
block. So, if any exception occurred in the try block, then
"tmp" would not be assigned with any value. Because of this
finally block will raise an exception like "local variable
tmp tried to use before the assignment".
This patch resolves that issue by defining "tmp" variable before
try block.
Jay S. Bryant [Thu, 20 Nov 2014 17:06:48 +0000 (11:06 -0600)]
context.elevated() should use copy.deepcopy()
Currently context.elevated is just doing a copy.copy(self).
This needs to be changed to use copy.deepcopy so that the
list reference is not shared between objects which leaves
the possibility of an admin role leak.
This fix changes context.elevated use copy.deepcopy.
ChangBo Guo(gcb) [Mon, 10 Nov 2014 12:45:12 +0000 (20:45 +0800)]
Switch Cinder to use oslo.concurrency
Let's switch to the newly released oslo library for the
processutils and lockutils. We use the config fixture(s) to
specify disable_process_locking and lock_path in the CONF
variable of oslo.concurrency library for correctly setting the
flags.
ChangBo Guo(gcb) [Mon, 10 Nov 2014 08:53:18 +0000 (16:53 +0800)]
Use oslo.utils
oslo.utils library now provides the functionality previously in
oslo-incubator's excutils, importutils, network_utils, strutils
timeutils, units etc. Some of these outdated modules will still be
around for a while until all other oslo modules that use them have been
updated in future commits.
Mike Mason [Mon, 17 Nov 2014 09:58:10 +0000 (09:58 +0000)]
Implementing the use of _L’x’/i18n markers
Placing the _Lx markers back into the code. No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.
This is the sixth commit of this kind
ChangBo Guo(gcb) [Mon, 10 Nov 2014 06:32:44 +0000 (14:32 +0800)]
Switch to oslo.serialization
Very simple import change in each file, just touches a whole
lot of files. jsonutils has graduated into a standalone library
and has been removed from the oslo-incubator repository.
We should be using the library for all projects.
This commit doesn't change files synced from oslo-incubator, and
doesn't remove the 'module=jsonutils' in openstack-common.conf.
Another sync commit will cover that.
John Griffith [Tue, 18 Nov 2014 19:37:11 +0000 (12:37 -0700)]
Fix typo in SolidFire xDBVersionMismatch label
The retryable errors list in the SolidFire driver includes
an xDBVersionMismatch error that can be emitted from the
device. During some recent work however the spelling of
the error was incorrect, so it's never deteceted/retried
as it should be.
This patch fixes the typo from 'xDBVersionMisMatch' to
xDBVersionMismatch'.
rick.chen [Wed, 12 Nov 2014 03:50:37 +0000 (11:50 +0800)]
Fix a problem in creating consistency group in ProphetStor driver.
a.Failed to create CG in the storage:
Storage site cannot accept CG uuid including "-" word. Before
sending API to back-end storage, the "-" word in the CG uuid
needs to be removed.
b.Failed to delete volume of CG:
Corrected api leaving group operation key.
Xing Yang [Tue, 18 Nov 2014 04:28:39 +0000 (23:28 -0500)]
Disable Cgsnapshot APIs by default
Currently consistency group APIs are disabled by default because there are
only a very small number of drivers that have implemented them. In
cinder/etc/cinder/policy.json, there are the following entries:
Note that Cgsnapshot related APIs are not disabled by default. They should be
disabled to be consistent. So the policy entries will be changed to the
following in this patch:
Pascal Wehrle [Mon, 17 Nov 2014 22:20:17 +0000 (23:20 +0100)]
allow image_id for imageRef in create volume API v2
The create volume request for the V2 API has a property named
"imageRef" with the ID of the image to be used when creating the
volume.
The name of this property is inconsistent as all multi word
properties use snake case and the property in the reponse is named
"image_id".
This adds support for aliasing the imageRef key with image_id when
creating a volume in v2 of the Cinder API in a backward-compatible
way.
Jay S. Bryant [Mon, 17 Nov 2014 19:11:03 +0000 (13:11 -0600)]
Update cinder.conf.sample to fix max db conn retries
Another external library change (oslo.db) has broken the gate
because cinder.conf.sample appears to be out of date. The change
was just to a message string:
Maximum number of database connection retries during
startup. Set to -1 to specify an infinite retry count. (integer value)
->
Maximum db connection retries during startup. Set to -1 to
specify an infinite retry count. (integer value)
This patch updates cinder.conf.sample to get beyond this failure. The
Cinder team will be talking about how to avoid these issues in the future.
Sean McGinnis [Sat, 15 Nov 2014 01:39:54 +0000 (19:39 -0600)]
Add i18n _LX tags for relevant log levels in EQLX driver.
The decision has been made to follow the translation
convention used in other projects of marking all INFO
and above log strings with _LI, _LW, or _LE. This patch
adds these markers for all log strings in the EQLX
driver that are not being used in an exception or where
array output is being logged.
John Griffith [Fri, 14 Nov 2014 18:26:07 +0000 (11:26 -0700)]
Bump Req timeout to 30 seconds in SolidFire Driver
Local SolidFire CI system seems to have various networking
disconnects during runs. This appears to be a problem with
latencies in our lab.
Currently have resources working on this, but in the meantime
bumping the timeout value in requests to see if we can address
it that way and get CI running again. We'll either get to root
cause in our network or add this as a formal config option later
that will be used only for SolidFire CI system.
git-harry [Fri, 14 Nov 2014 17:10:58 +0000 (17:10 +0000)]
Remove cinder/compute/aggregate_states.py
This file is from the initial fork from nova. It defines the states a
host aggregate can take. It is not used anywhere in the cinder code
and is therefore unnecessary.
git-harry [Fri, 14 Nov 2014 11:22:39 +0000 (11:22 +0000)]
Remove deprecation warnings relating to api-paste
Remove deprecation warnings and backwards compatibility introduced by
commit c355d68a. This commit was introduce in havana and backported to
grizzly. It relates to config options in api-paste.ini.
This commit removes the following deprecated items:
* cinder.api.auth:CinderKeystoneContext
* cinder.api.auth:pipeline_factory
* cinder.api.openstack:FaultWrapper
* cinder.api.openstack.urlmap:urlmap_factory
* cinder.api.openstack.volume:APIRouter
* cinder.api.openstack.volume.versions.Versions
* cinder.api.sizelimit:RequestBodySizeLimiter
git-harry [Fri, 14 Nov 2014 09:09:55 +0000 (09:09 +0000)]
Mock isfile in test_ssh_missing_hosts_key_file
test_ssh_missing_hosts_key_file tests that when the ssh_hosts_key_file
is missing an InvalidInput exception is raised. It does this by
setting CONF.ssh_hosts_key_file to, what is assumed to be, the
location of a non-existant file. If the file, /tmp/blah, exists the
test fails. This test should not be dependent on what is on the
filesystem.
This commit adds a mock for os.path.isfile so that when
ssh_utils.SSHPool checks for existance of CONF.ssh_hosts_key_file it
always gets False regardless of the state of the filesystem.
Mike Mason [Tue, 11 Nov 2014 14:05:24 +0000 (14:05 +0000)]
Implementing the use of _L’x’/i18n markers
Placing the _Lx markers back into the code. No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.
This is the fifth commit of this kind
JordanP [Thu, 13 Nov 2014 16:14:00 +0000 (17:14 +0100)]
Scality driver:use self.configuration instead of CONF
In order for the Filter scheduler to be used to it's full advantage
Cinder drivers need to move away from using FLAGS directly and switch
to appending their specific options to self.configuration.
This patch converts the driver and updates tests.
Commit message stolen from Id1a7c583894ac368bdcc61facc6f72300db320c7
Closes-Bug: #1392633
Change-Id: I61b0b6a21628d5629b5f80768e73ee44db05d1ce
John Griffith [Thu, 13 Nov 2014 14:43:13 +0000 (07:43 -0700)]
Explicitly close requests obj in SolidFire Driver
Currently we're not explicitly returning requests
connection objects back to the ConnectionPool when
we're done with them. For most cases this isn't a
problem, however if we start adding higher and higher
concurrent actions the internal Connection Pool management
doesn't keep up.
This patch just adds an explicit close of the requests
connection after we're done with it to keep the ConnectionPool
as full as possible and avoid any resource issues that could
occur during heavy concurrent usage.
Manojkiran [Wed, 29 Oct 2014 02:36:24 +0000 (08:06 +0530)]
Add volume attribute support to volume created using clone, snapshot
The following patch adds support for volume attributes (setting of
storage pool, replicas, dio, write affinity etc) in case of volume
creation triggered using snapshot, clone.
Patrick East [Fri, 22 Aug 2014 23:43:20 +0000 (16:43 -0700)]
Add automatic creation and deletion of Purity hosts for PureISCSIDriver
The driver will now be responsible to manage hosts for new initiators
which do not already have a host created for them. This will allow for
backwards compatibility with the previous version that relied on hosts
being pre-configured for use by Cinder.
Matthew Edmonds [Tue, 11 Nov 2014 21:03:23 +0000 (16:03 -0500)]
Fix Brocade FC SAN lookup MITM vulnerability
Modify the Brocade FC SAN lookup service implementation to use the
same SSH key config properties used elsewhere rather than relying on
arguments which are non-standard and never passed by the base lookup
service.
Mike Mason [Thu, 6 Nov 2014 13:37:37 +0000 (13:37 +0000)]
Implementing the use of _L’x’/i18n markers
Placing the _Lx markers back into the code. No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.
This is the third commit of this kind
David Pineau [Thu, 6 Nov 2014 14:01:13 +0000 (15:01 +0100)]
Fix the LV NotFound situation for thin-type LVM
If the logical volume is not found, LVM displays on the error output
that the volumes could not be found. So here, we filter on this very
specific situation, and let all the other cases go through the stack.
Added a test for this new code path, which raises an exception of the
proper type to be caught by the new code.
Brianna Poulos [Thu, 6 Nov 2014 21:07:16 +0000 (13:07 -0800)]
Fix wrapper to work with barbicanclient 3.0.1
Due to the updates to the python-barbicanclient in version 3.0.1, the cinder
barbican wrapper no longer functions. This patch updates the cinder barbican
wrapper and test cases to work with barbicanclient 3.0.1.
Matt Riedemann [Fri, 7 Nov 2014 14:23:09 +0000 (06:23 -0800)]
Retry remove iscsi target
There is a race in the gate when removing an iscsi
target in the remove export flow where the target
is still active. It's about a 75% failure rate so
simply adding a configurable retry on the delete
call should clean that up.
Anthony Lee [Tue, 21 Oct 2014 13:36:39 +0000 (06:36 -0700)]
Adding support for 'source-id' in 3PAR manage
Changed 3PAR's manage volume functionality to support the use of a
'source-id' id-type. By default the name of the volume to manage can
be used but if an admin wants to use the volume ID instead they can
set the optional --id-type argument to 'source-id' now.
John Griffith [Tue, 4 Nov 2014 22:34:28 +0000 (23:34 +0100)]
Remove test_barbican from keymgr tests
Unfortunately it seems we have some very poorly
written keymgr unit tests, specifically
keymgr/test_barbican.py does this:
from barbicanclient.common import auth
First problem is that from a unit test perspective
that pretty much sucks, second problem is that
barbicanclient as of version 3.0.0.0 no longer
has an "auth" module, as a result Cinderunit tests
now fail.
The test_barbican.py unit tests need to be rewritten
to mock out the client components and actually test
Cinder components where needed without relying on
the barbicanclient.
For now in order to free up the gate, remove test_barbican.py
Mike Mason [Thu, 23 Oct 2014 13:16:42 +0000 (13:16 +0000)]
Implementing the use of _L’x’/i18n markers
Placing the _Lx markers back into the code. No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.
liu-sheng [Mon, 3 Nov 2014 08:45:22 +0000 (16:45 +0800)]
Capture exception when delete a volume detached
Currently, the cinder api validate volume state before validating volume
attach status, so the VolumeAttached exception will never be raised. this
patch change the order of validation to fix this issue.
ZhiQiang Fan [Sat, 1 Nov 2014 18:18:35 +0000 (02:18 +0800)]
Disable python-barbicanclient 3.0.0 version
python-barbicanclient 3.0.0 has introduced cliff module, but pins it
to 1.6.1, while global-requirements set it to >=1.7.0, now the whole
OpenStack projects depends on higher version of cliff, but
python-barbicanclient is needed by cinder, then grenade test will
fail because: pkg_resources.DistributionNotFound: cliff==1.6.1
As long as python-barbicanclient maintainers don't provide a patch
for 3.0.0 (which seems not happen FMPOV), we need to disbable this
version.
Mike Mason [Fri, 17 Oct 2014 10:46:26 +0000 (10:46 +0000)]
Amend unused variables to assist pylint testing
Amedning unused variables with a prefix of an underscore to prevent them
being picked up in pylint testing, consistency, and for general housekeeping.
Change to pylintrc also required to enforce the rule.
Adrien Vergé [Tue, 28 Oct 2014 21:00:09 +0000 (22:00 +0100)]
Cleanly override config in tests
CONF.set_override() is often called in tests but CONF.clear_override()
is never. Create a override_config() method in the base TestCase class
that restores previous conf value after test, as it is done in other
OpenStack projects.