Commit Graph

22 Commits

Author SHA1 Message Date
Eric Harney b1d0be7b26 Remove six from GPFS driver
Change-Id: Iccc8d642e21b05ca22a0260979f3bbc0578731cd
2023-03-30 13:01:55 -04:00
digvijay2016 dcc1916469 Fixed copy-on-write mode in GPFS NFS driver
IBM Spectrum Scale cinder driver (GPFS) support copy-on-write feature
in all the configuration. Resolving the bug mentioned below will
enable mmclone feature of the IBM Spectrum Scale filesystem to provide
better performance while configured in GPFS NFS mode.

Closes-Bug: #1947134
Closes-Bug: #1947123
Change-Id: I3e77c890c7abca85dab92500eae989b4dff9824d
2021-11-02 18:54:18 -04:00
Eric Harney d4eb4a9ba1 Move unit test code under tests/unit/
test.py was previously not in the tests
directory.  This means that downstream packagers
of Cinder have to specifically exclude it from
the main Cinder package (which does not typically
include unit tests).

Move it under the cinder/tests/unit/ dir where it
should be, to clean this up.

Change-Id: I65c50722f5990f540d84fa361b997302bbc935c5
2020-04-30 18:13:54 -04:00
Abhishek Kekane 350973f3dd Support multiple stores of Glance
Glance now has ability to configure multiple stores at a
time. To use this feature in cinder for uploading volume to image, operator
need to define a new field named 'image_service:store_id' in the
volume-type extra-specs. At a time of volume upload to image request, if
'image_service:store_id' is present in the associated volume type, then
image will be uploaded to specified 'store_id'. The value 'store_id' is
nothing but store identifier defined in glance-api.conf. If the value
of 'image_service:store_id' is null or not set in volume-type then the
image will be uploaded to default store in glance.

Co-authored-by: Sagar Waghmare <sawaghma@redhat.com>
Co-authored-by: Abhishek Kekane <akekane@redhat.com>

DocImpact
Implements: bp support-glance-multiple-backend

Change-Id: Ica56833a1d9fb9f47b922dbbc6558901bb3a2800
2020-01-21 06:02:47 +00:00
Sean McGinnis 3eb9b422f4
Introduce flake8-import-order extension
This adds usage of the flake8-import-order extension to our flake8
checks to enforce consistency on our import ordering to follow the
overall OpenStack code guidelines.

Since we have now dropped Python 2, this also cleans up a few cases for
things that were third party libs but became part of the standard
library such as mock, which is now a standard part of unittest.

Some questions, in order of importance:

Q: Are you insane?
A: Potentially.

Q: Why should we touch all of these files?
A: This adds consistency to our imports. The extension makes sure that
   all imports follow our published guidelines of having imports ordered
   by standard lib, third party, and local. This will be a one time
   churn, then we can ensure consistency over time.

Q: Why bother. this doesn't really matter?
A: I agree - but...

We have the issue that we have less people actively involved and less
time to perform thorough code reviews. This will make it objective and
automated to catch these kinds of issues.

But part of this, even though it maybe seems a little annoying, is for
making it easier for contributors. Right now, we may or may not notice
if something is following the guidelines or not. And we may or may not
comment in a review to ask for a contributor to make adjustments to
follow the guidelines.

But then further along into the review process, someone decides to be
thorough, and after the contributor feels like they've had to deal with
other change requests and things are in really good shape, they get a -1
on something mostly meaningless as far as the functionality of their
code. It can be a frustrating and disheartening thing.

I believe this actually helps avoid that by making it an objective thing
that they find out right away up front - either the code is following
the guidelines and everything is happy, or it's not and running local
jobs or the pep8 CI job will let them know right away and they can fix
it. No guessing on whether or not someone is going to take a stand on
following the guidelines or not.

This will also make it easier on the code reviewers. The more we can
automate, the more time we can spend in code reviews making sure the
logic of the change is correct and less time looking at trivial coding
and style things.

Q: Should we use our hacking extensions for this?
A: Hacking has had to keep back linter requirements for a long time now.
   Current versions of the linters actually don't work with the way
   we've been hooking into them for our hacking checks. We will likely
   need to do away with those at some point so we can move on to the
   current linter releases. This will help ensure we have something in
   place when that time comes to make sure some checks are automated.

Q: Didn't you spend more time on this than the benefit we'll get from
   it?
A: Yeah, probably.

Change-Id: Ic13ba238a4a45c6219f4de131cfe0366219d722f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-01-06 09:59:35 -06:00
Eric Harney de789648e5 Rename volume/utils.py to volume/volume_utils.py
Much of our code renames this at import already --
just name it "volume_utils" for consistency, and
to make code that imports other modules named "utils"
less confusing.

Change-Id: I3cdf445ac9ab89b3b4c221ed2723835e09d48a53
2019-09-09 15:00:07 -04:00
Walter A. Boring IV e049afa652 move GPFS driver exception to driver file
This patch moves the GPFS specific driver exception to
the driver file itself.

Change-Id: I25e4a9abb351b208b4efac1b0fa5b77101f74ff6
2019-05-03 16:18:28 +00:00
Eric Harney ade7d89c2e Revert "Remove truncate from rootwrap filters"
This reverts commit a62c9dfdd4.

This did not account for cases where truncate is
called w/o elevated privileges.

Related-Bug: #1818504
Change-Id: I3cb85be854e68fda525cfebe254ce7c85d8e3d37
2019-03-06 10:08:10 -05:00
Charles Short a62c9dfdd4 Remove truncate from rootwrap filters
Use oslo.privsep for the truncate command.

Change-Id: Ic287c64a4e0f663738e23d22e819b6ffee9c84c1
Signed-off-by: Charles Short <chucks@redhat.com>
2019-02-21 16:34:01 -05:00
Eric Harney 9e12a40b5c Tests: Fix coverage unit test failure
This fixes a failure in "tox -e cover"
due to a MagicMock being passed to dirname().

Change-Id: Ia3d9cdecb2567ae40bc61d5d1f7c33b607d3fbad
2017-10-25 15:59:00 -04:00
Michał Dulko 1f62a411f4 Move driver options to "backend_defaults" section
Our cinder.conf.sample lists all of the options that are defined by
drivers in the [DEFAULT] section. Since removal of single-backend config
(without enabled_backends) this is misleading as those options are
functional only when defined in [<backend_name>] section. This commit
aims to move all of the driver options to [backend_defaults] section.
Assumption is that this will affect only sample config generation and
should not break anything else.

Change-Id: Ia4766eb313e15adc92a92875519b22db64e95d65
2017-07-03 16:42:03 +02:00
Jenkins 1fa43b8f79 Merge "Tests: Disallow use of assertTrue(str)" 2017-06-18 20:45:32 +00:00
Eric Harney 7a84172cb2 Tests: Disallow use of assertTrue(str)
self.assertTrue(string) is fairly dangerous because
things like self.assertTrue('False') will pass.

Require a more specific assertion when passing a
string to assertTrue, which should help prevent mistakes.

Fix up tests that do this currently, some of which
appear to not be testing what they intended.

Change-Id: I0cd29b9f3247ae5b7b3c478b96970b73d69a72c0
2017-06-15 12:09:52 -04:00
Gaurang Tapase 6252bd8e5a Add CG capability to generic groups in GPFS driver
This patch adds the consistency group capability to generic group in
GPFS driver. Consistency groups will be used as generic groups.

Change-Id: I31b210a7186e9212b85ce4ec17693c1ae4bed908
Closes-bug: #1682249
2017-06-12 08:04:08 -04:00
Gaurang Tapase 49932bbd34 GPFS: Fix forceful delete for consistency group
This patch fix the force delete for a consistency group
when the backend object (fileset) doesn't exist.

Change-Id: I81c4fc8fd913be11d88dcbcdd38dde88144af8bd
Closes-bug: #1694189
2017-05-30 14:42:55 -04:00
Gaurang Tapase 77d17a1f8b GPFS: Handle unsupported operations with an exception
This patch adds a support to fail the unsupported CG operations
for GPFS driver with GPFSDriverUnsupportedOperation exception.

Change-Id: Icd5a693ac75eca0f55cc3ecb014feb192e9e84d7
Closes-bug: #1691526
2017-05-23 01:30:52 -04:00
Jenkins 33e0c5d132 Merge "Remove backup-restore methods in driver code" 2017-05-22 16:22:30 +00:00
digvijay2016 b812f1269b Fix forceful deletion of Consistency Group for GPFS Driver
For a operation of deleting consistency group when it contain
one or more volumes, GPFS driver is currently returning a list
of Volume objects to cinder volume manager which is expecting
a list of dictionaries to use for updating the volumes.

With this patch, GPFS will be able to delete consistency group
forcefully too.

Change-Id: Ie56c443a2a07c86001cbb9269058aaa0ccca6e84
Closes-bug: #1685355
2017-05-12 16:31:06 +05:30
Vipin Balachandran a4822a849a Remove backup-restore methods in driver code
Commit faee0520a4 removed
backup_volume() and restore_backup() volume driver calls
in the backup manager to reduce the coupling between the
backup service and the volume service. Removing the
obsolete backup-restore code in drivers.

Change-Id: I984de3df803f12dbb95e3309e668b3fbd519e70f
2017-05-04 10:55:20 -07:00
Gaurang Tapase 645bac5ae6 GPFS: Enhance GPFS driver to work in container
This patch enhances the GPFS driver to support the
use case when cinder service is running inside Linux
container hosted on Nova-Compute node (This kind of an
environment is deployed by OpenStack Juju Charm).
With this change, driver would talk to GPFS client
on Nova-Compute nodes over ssh.

Change-Id: Ib3235999d1b34502cdcc8efc359cfc6f5df0412a
2017-04-25 14:10:02 -04:00
ChangBo Guo(gcb) ccd8abb7f1 Fix wrong usage of config option gpfs_images_share_mode
Config option gpfs_images_share_mode with parameter choices=['copy',
'copy_on_write', None], that means any other value will raise
ValueError, the check is done by the configuration parser, so no
invalid value will be accepted and the driver doesn't need to check it
again. For more details when we set method set_override with paramter
enforce_type=True, please see: http://paste.openstack.org/show/523740/

Related-Bug: 1517839

Change-Id: I000ab639e68534e7be111cc3759b6ae1dffd5520
2016-12-01 18:48:33 +08:00
Ivan Kolodyazhny 39e0c888ba Move drivers unit tests to unit.volume.drivers directory
This change makes our tests directory cleaner a bit and
helps to find tests faster.

Some of these tests freeze for a long time, so they are skipped.

Related-Bug: #1578986

Change-Id: Ic292b9608cd3d174a2b9b30e7d941e728f32547c
2016-07-25 17:39:50 -04:00