Commit Graph

46 Commits

Author SHA1 Message Date
Brian Rosmaita f165c6ff5e Stop cinderlib development
Remove files from master, as development will no longer occur there.
The stable branches continue to be supported while they are in
Maintained status.

Updated the README to indicate this change.

Depends-on: Ib186ac5830e5920e264d79be946995e63e960426
Depends-on: I081cd363117671eaab6a3193094d5872f9820354
Depends-on: If2b9a82cddb20543b176ee22765049db257c89b9
Depends-on: I1143e5e5ccf8103e386fe1ce614a554e7f152d9a
Change-Id: I4722b869033ad1bd357e36c4a258b6d3ea61f5d6
2024-01-05 16:03:46 +00:00
Zuul 9c37686f35 Merge "Remove unnecessary #egg= URL fragment" 2023-01-21 01:23:16 +00:00
Brian Rosmaita 642fbea5e4 Remove unnecessary #egg= URL fragment
There's discussion in the pip project about removing support for
the '#egg=name' in a URL requirement specifier [0].  Since it's
redundant in our current usage in cinderlib (since the URL base
component and the package name are the same for os-brick and
cinder), just remove it and then whatever they decide to do about
this in upstream pip won't affect us.

[0] https://discuss.python.org/t/killing-off-the-egg-fragment-once-and-for-all/21660

Change-Id: If4ce5cbac388eea99ecfc5d4baee15397a61d6e5
2022-12-16 10:09:26 -05:00
niuke af3a22e306 remove unicode prefix from code
Change-Id: Iea2b4f8ce22b7592242d140a722ac234d84a7f7d
2022-08-23 19:06:45 +08:00
Zuul 47914d29c3 Merge "[docs] add zuul.yaml maintenance tasks" 2022-07-22 13:05:15 +00:00
Zuul a59051690c Merge "Update doc/requirements.txt" 2022-07-15 18:24:43 +00:00
Brian Rosmaita 7dfef254c0 [docs] add zuul.yaml maintenance tasks
Change-Id: I20f5c64eaa2de3116efb12c4046b6ee63888a0f3
2022-07-11 10:06:49 -04:00
Brian Rosmaita 7be24a5578 [docs] add tox, zuul maintenance tasks
Explain what configuration changes need to be made during
the trailing phase of cinderlib development, when cinderlib
master is still the development branch of the previous release
cycle.

Change-Id: I8c56b1ee15dfdb71d82ea856729b3ebe65029bbe
2022-06-25 09:45:38 +00:00
Brian Rosmaita 94eaa5e39b Update doc/requirements.txt
Requirements check job will fail if we don't have a min for
sphinxcontrib-svg2pdfconverter.  Setting it to >=0.1.0 based
on a codesearch of openstack (that's what everyone else is
using).

Change-Id: Iaff8ad0df30dda8b439dbce832680130b91fbc1a
2022-06-08 08:53:22 -04:00
Brian Rosmaita c47820d063 Update contributor docs
Add info about some manual maintenance of tox.ini and requirements
at the coordinated release time and after cinderlib release.

Change-Id: Ib5aed7582627262feb30afac27ddaa29840f7558
2021-06-30 09:45:28 -04:00
Zuul 6ffa1c9447 Merge "Remove reliance on embedded imports" 2021-06-16 08:30:43 +00:00
tushargite96 724419fb9e Moving to OFTC
Change-Id: I8820c3d1231e7862f4f4092484cc07d485d487b0
2021-06-01 10:15:00 +05:30
Stephen Finucane e1008c79a9 Remove reliance on embedded imports
Instead of relying on cinder's import of sqlalchemy, import it
ourselves.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I9a163d002ad7151a0cbdb04fba137688e0316944
2021-04-20 11:38:20 +01:00
tushargite96 390f04f433 Dropping explicit unicode literal
In python 3, all strings are considered as unicode string.

This patch drops the explicit unicode literal (u'...')
or (u"..") appearances from the unicode strings.

Change-Id: I8cf2c7a1532e1df454321387a2d49e3f1e5ed1b7
2021-02-17 19:08:41 +05:30
Gorka Eguileor b6ddbcda43 Support references in driver configuration
Cinder, through Oslo Config, supports references as values in its
configuration options, such as the default value used in
target_ip_address which is $my_ip.

This patch adds the same functionality to cinderlib, which is convenient
for library users that use the default values reported by the
list_supported_drivers for the options to set the values.

In other words, if for example we don't pass target_ip_address for the
LVM driver configuration, then it correctly uses the value of my_ip
field, but if we get the default value and pass it, the driver will
fail, since the literal '$my_ip' is not usable as an IP address.

Change-Id: I038da3637268c9e43c464e841f8c357b212fbc9f
2020-07-14 11:28:00 +02:00
Gorka Eguileor a37a93154f Improve cinder supported drivers output
Method list_supported_drivers was intended for human consumption, so all
values for the options in driver_options where strings, which makes it
harder to parse by automation tools since they have to:

- Convert values from 'None' to ``None``, 'False' to ``False``, etc.
- Parse a string with type of the option to determine the additional
  options, such as choices, max and min values.

This patch adds the possibility to get an output intended for automation
tools.

To maintain backward compatibility the method accepts
``output_version`` parameter that defaults to ``1`` (old output) but can get
``2`` for the new output.

Change-Id: I2ade5d2e6b2c97d905e09fee509c81c2cfb602ed
2020-07-14 11:25:42 +02:00
Andreas Jaeger c0641a1cb7 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I69fc009dd2ba86c47a9e113212e8c79b8afcb008
2020-05-21 12:56:25 +02:00
Zuul 18f85d8b25 Merge "Drop use of unittest2" 2020-03-24 10:57:41 +00:00
Brian Rosmaita 154e80d340 Ussuri contrib docs community goal
This patch standardizes the CONTRIBUTING.rst file and adds
doc/source/contributor/contributing.rst

Change-Id: I88f69618d7192b33fefa3696c7b494ff5a18d29d
2020-03-05 10:00:21 -05:00
Sean McGinnis 2f55c3ae2e
Drop use of unittest2
unittest2 was needed for Python versions <= 2.6, so it has not been
needed for quite awhile (ever in this project). See unittest2 note on:

https://docs.python.org/2.7/library/unittest.html

This drops unittest2 in favor of the standard unittest module.

Change-Id: I21264290d783d582dfb886b799781380dbf5757d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-01-12 02:48:30 -06:00
Luigi Toscano 08108b5964 Use Python 3 by default and drop Python 2
Follow the rest of OpenStack and consistently switch to
python3 as default python interpreter and drop python2.

The "functional" tox target was failing with Python 2
as cinder/master has cut the Python 2.7 compatibility.
"functional" now points to the default python3. An explicit
"functional-py37" target has been added as well.

Fix the functional jobs as well:
- move the LVM job to centos-8 and adapt it when needed;
- move the Ceph job to ubuntu-bionic, as there are no
  CentOS 8 Ceph packages (and the CentOS 7 ones do not
  provide Python 3 bindings).

Closes-Bug: #1853372
Change-Id: Iea4f4f53df7400248848399494564910d3870f63
2020-01-10 15:03:23 +01:00
Gorka Eguileor fbd7a72c1b Fix configuration options
When fixing bug #1854188 (Change-ID:
I62e992804a3ae6aa0b4aa4f883807783197d4b33) we broke configuration
options, because now we cannot pass configuration options from the
DEFAULT section, and some ListOpt don't work because cinderlib was
incorrectly expecting all these options to have bounds=True, but some
don't define it and default to False.

Most of the "crazy" code we currently have around oslo config is because
we wanted to support drivers that add configuration options on runtime
and reload the configuration.

This made sense when cinderlib was not an OpenStack official project,
but now that it is it makes more sense to force Cinder drivers to do the
right thing.

Aligned with this, this patch removes all the faking of the cinder.conf
file as a StringIO object, and simply sets things in the configuration
object that is passed to the drivers, which is the only thing they
should be using.

This will make cinderlib code more robust, even if some drivers will now
need to be modified to work with cinderlib.

We are validating known configuration options and ignoring unknown ones,
like Cinder does.

The NetApp driver was one of the drivers that would get broken, but
since I have access to it and we can make a very small and targeted
workaround to avoid breaking it, we do it as well.

Closes-Bug: #1856556
Change-Id: I67fbf8e9d7ee79f3d6617b4d0ae755dae0e1987a
2019-12-19 11:05:22 +01:00
Zuul d81fbeb3a9 Merge "Support passing pool to functional tests" 2019-12-13 23:26:05 +00:00
Gorka Eguileor 6fd1e625ef Support passing pool to functional tests
For backends with support for multiple pools we need to be able to
configure the pool we want to use during the cinderlib functional tests,
since we don't have preconfigured volume types like we may have in
Cinder.

Change-Id: I4221814434d9141d42f53bd9f6e22112c3fad7a0
2019-12-04 19:39:53 +01:00
Zuul f7d41144c7 Merge "Enhance extend functionality" 2019-11-28 04:59:54 +00:00
Gorka Eguileor 6f989af09b Enhance extend functionality
Cinderlib's volume extend functionality would extend the volume in the
backend yet ignore any refresh of the view of the volume if it was
attached.

It also didn't provide a way to refresh the view of an extended volume
given a Connection instance.

This patch adds the funtionality to automatically refresh the view when
extending a locally attached volume as well as to do the refresh using a
Connection instance.

The refresh is done making the appropriate extend_volume call to
os-brick's connector.

The OS-Brick RBD connector doesn't have the method because there's
nothing for it to do, but to provide a consistent API we add the method
to our NOS-Brick to return the new size like other connectors do.

Change-Id: I04a29597e7515526fb8505c76c3d7e3026b2d9c8
2019-11-19 03:25:29 +01:00
Zuul 7f61d74337 Merge "Fake unused packages" 2019-10-24 13:46:07 +00:00
Gorka Eguileor 76d0164fb0 Fake unused packages
Many packages that are automatically imported when loading cinder
modules are only used for normal Cinder operation and are not necessary
for cinderlib's execution.

One example of this happening is when cinderlib loads a Cinder module to
get configuration options but won't execute any of the code present in
that module.

This patch fakes these unnecessary packages, providing faster load
times, reduced footprint, and the possibility for distributions to
create a cinderlib package or containers with up to 40% fewer
dependencies.

Change-Id: If577b9163d4e942b701db4b2a47cd66e6bd17b6f
2019-10-21 21:28:28 +02:00
Walter A. Boring IV 8f85976e87 Add pdf build support
This patch also adds support to deal with inline svg images

This patch updates the documentation config to allow
the docs to build in pdf.

use 'tox -e pdf-docs' to build

Change-Id: I3227509d7a6d3be45a76562f69553c845f0bf27a
2019-09-04 13:34:47 +00:00
Zuul 3d87ffdb8a Merge "Follow Up: Fixing NITs" 2019-08-31 23:42:42 +00:00
Zuul 1073729b5e Merge "Bump the openstackdocstheme extension to 1.20" 2019-08-30 06:58:09 +00:00
whoami-rajat 2d24b657f5 Follow Up: Fixing NITs
As per review comments on [1], fixing NITs.

[1] https://review.opendev.org/#/c/651880/

Change-Id: I6f030408dcb8910f5ae853e5ee91fdde4b494d5f
2019-08-14 09:42:31 +05:30
Zuul 186f33df5e Merge "Bump openstackdocstheme to 1.20.0" 2019-08-08 13:58:01 +00:00
Zuul 664eee9b10 Merge "Sync Sphinx requirement" 2019-08-08 11:01:55 +00:00
Zuul 539d9a94e2 Merge "Add validation and validated documentation" 2019-08-06 22:01:31 +00:00
Gorka Eguileor bee4135ee9 Add validation and validated documentation
This patch adds documentation related to the validation of Cinder
drivers for cinderlib usage.

With a guide on how to manually validate a driver using DevStack, and
how to add cinderlib functional tests to gate jobs.

Also presents a list of cinderlib validated drivers with their
configuration to serve as a reference for developers.

Depends-On: I25c19cf1f7da6881807e729a326cd94d07b4c42d
Depends-On: Ia532b3fcfbecee7c6dc7aa302e6d90a8067b7ff0
Change-Id: I2c184af9e48c3b2f4af7182fb000272f9e162be4
2019-08-06 17:51:37 +02:00
pengyuesheng fd90bc6900 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

Change-Id: Ifbb7aeb2a9e0963faefadeaaed8bc8b3738a9c78
2019-08-01 10:46:54 +08:00
pengyuesheng a6c33c2f7f Sync Sphinx requirement
Sync sphinx dependency with global requirements. It caps python 2 since
sphinx 2.0 no longer supports Python 2.7.

Change-Id: I4be36c173796e85379fac0091dc36ce55832d70a
2019-07-31 17:28:01 +08:00
whoami-rajat 0b27b64e35 [DOC]:Correct variable name kv
Change-Id: I717865505bd5802befcafbac6963ea5ddabc0eeb
2019-07-29 15:49:06 +05:30
xuanyandong 8974ba2529 Bump openstackdocstheme to 1.20.0
Change-Id: Ia4cf0044c23665e715ff45a4fc6d0e6e472b6c4e
2019-07-16 16:57:55 +08:00
Gorka Eguileor 46565c4995 OpenDev Migration Patch
This patch migrates cinderlib to the new OpenDev code review system as
described in these mailing list messages:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Change-Id: I53af5de68e021896a2bd940b4a8901dedc1f6a04
2019-04-26 16:28:35 +00:00
Zuul c99944412a Merge "Fix get_connector_properties" 2019-04-10 20:24:11 +00:00
Gorka Eguileor 502f4ce9f4 Fix get_connector_properties
We get exception oslo_privsep.daemon.FailedToDropPrivileges when calling
cinderlib.get_connector_properties.

This is because we make it point to OS-Brick's original method, which we
later replace when we do the init in nos-brick.  So cinderlib always
call the replaced method, while cinderlib users will be calling the
original OS-Brick method that hasn't replaced the privsep code.

This patch fixes this by assigning our get_connector_properties method
to the cinderlib method during the nos-brick initialization.

We also have a tiny doc change where we were saying connection instead
of connector, and some cosmetic changes in nos_brick to improve
readability, since we were using acronyms bgcp and bcp, which we now
replace for some more meaningful names.

Closes-Bug: #1822976
Change-Id: I627289418d52bdab826d1cf1a941e5671aaf2239
2019-04-04 15:55:30 +02:00
whoami-rajat 42b650e6cc DOCFIX: correct syntax of codeblock
This would fix the wrong view at [1] of LVM driver.

[1] https://docs.openstack.org/cinderlib/latest/topics/backends.html#installed-drivers

Change-Id: Ic82cc73341d7b3edbad3dcc9b334e820bb806cd4
2019-04-03 21:25:27 +05:30
Gorka Eguileor cd5365db2f Add zuul jobs
This patch adds the following Zuul CI jobs:

- Python 2.7 unit tests
- Python 3.6 unit tests
- Functional tests with LVM
- Functional tests with Ceph
- Publis documentation
- Release notes

Change-Id: I2f3f34c1db4716b323c48908f51500898c2c6242
2019-02-26 16:21:34 +01:00
Gorka Eguileor 77f399fd96 Format as a Cinder-related OpenStack project
Since we are going to be importing the project into OpenStack we need it
to follow the same structure as the other projects under the Cinder
umbrella.
2019-02-19 16:28:03 +01:00