Commit Graph

4 Commits

Author SHA1 Message Date
Mike Bayer 0ce2857d0f db: update migrations to use SQLA 2.0 patterns
All tests in test_migration.py pass with either SQLAlchemy 1.4
or SQLAlchemy 2.0 installed.

Change-Id: Ie8831c04b7b4515deea27b1ceb472d07cda91ca0
2024-04-03 19:26:23 -04:00
Goutham Pacha Ravi 3e855d5f60 [pylint] Fix/ignore pylint errors in non-test modules
Pylint does not play very well with dynamic object
manipulation in python This creates a lot of
false-positives in the code-base which affects
contributors looking for genuine failures.

So, this change
- adds pylint ignore statements where appropriate
  to disable testing these lines of code and failing.
- replaces all the pylint error codes (they are
  hard to remember/relate to) with error names
  which are easier to understand when reading the
  code.
- initializes sqlalchemy model objects as dictionaries
  which is a valid representation over None.
- removes ignore directives on six.moves which
  is globally ignored in our pylintrc.
- adds alembic.op to the ignored
  modules list since they are not supported by
  pylint and have known issues.

This patch is the beginning of a series of
commits to use pylint in a sane way on manila code.

Change-Id: I44616821c5311d6f14986697efbbe5624de364a5
2019-02-25 17:23:15 +00:00
zhongjun b422699924 Use parenthesis instead of backslashes in db folder
Use parenthesis instead of backslashes in db folder

TrivialFix
Change-Id: I6c2ea07b0bfc5852b28e44989406cc10eb972e13
2017-06-15 19:42:07 +08:00
Valeriy Ponomaryov af6814f9ca Add possibility to filter back ends by snapshot support
On last midcycle meetup was decided to make snapshots optional feature.

Features:
 - Add new boolean capability 'snapshot_support' to base share driver
   so every existing share driver will inherit it. Make value of it be
   calculated from the fact of redefinition of three main driver
   methods for snapshots 'create_snapshot', 'delete_snapshot' and
   'create_share_from_snapshot'.
- Set extra spec 'snapshot_support' with share type creation by default
  to 'True'
- Restrict deletion of extra spec 'snapshot_support' that is expected
  to exist
- Allow to redefine new extra spec 'snapshot_support'
- Restrict API 'snapshot create' for share created with
  share type that has extra spec 'snapshot_support' equal to 'False'.
- Add migration where new extra spec 'snapshot_support' is added
  to all share types that do not have it yet.

Partially implements bp snapshots-optional
Change-Id: I069d9e911c7d7a708fa518b38ed10572a45e5f42
2015-08-26 23:05:37 +03:00