Commit Graph

3856 Commits

Author SHA1 Message Date
Zuul d8987589ae Merge "Add job to test with SQLAlchemy master (2.x)" 2024-04-11 18:54:01 +00:00
Stephen Finucane 2a9ac87cc4 Add job to test with SQLAlchemy master (2.x)
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ib67538ebd0f8ebbea5a700343f52655b0f7fecd4
2024-04-10 16:41:55 -04:00
Zuul 28bb87ff77 Merge "tests: Don't (always) auto-create snapshot instances" 2024-04-09 18:56:41 +00:00
Zuul 56db40e344 Merge "db: rename_table is not a batch operation" 2024-04-09 18:49:54 +00:00
Zuul 221d4d940d Merge "Add delete CLI helper to ShareCommands" 2024-04-09 17:09:35 +00:00
Stephen Finucane 16b02bc706 tests: Don't (always) auto-create snapshot instances
If we are manually creating these things, we don't want any
automatically created. This is a latent issue that was being exposed by
SQLAlchemy 2.0's tweaked session management.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I9d760ebbfcca176a39b44f20fb92e16eaf6284c5
2024-04-06 09:51:36 +01:00
Okeke Christian 23de7b4b0c Add delete CLI helper to ShareCommands
This patch adds a delete cli command to ShareCommands
The helper CLI command checks if service if up. If service
is down, it deletes the share instance

Closes-Bug: #1867030
Change-Id: I6a0575c1ed86213010e50fe1b7a733cdf7fa1736
2024-04-05 16:08:55 +01:00
Stephen Finucane 825ee37432 db: rename_table is not a batch operation
This is reported upstream [1] but I suspect the root cause is that we
were relying on a bug in Alembic: renaming tables doesn't really make
sense as a batch operation, which by definition works by recreating
tables with an updated schema (to support SQLite and its lack of full
'ALTER' support).

[1] https://github.com/sqlalchemy/alembic/issues/1453

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I1da6d117778bbbad64b2df2dfd2f8aeef8a7084c
2024-04-05 13:00:28 +01:00
Stephen Finucane 9c94a9adfc db: Don't use strings to indicate relationship names
Resolve the following RemovedIn20Warning warning:

  Using strings to indicate relationship names in Query.join() is
  deprecated and will be removed in SQLAlchemy 2.0.  Please use the
  class-bound attribute directly.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I155b4ce4b605720c8335d465124fd32cc973a737
2024-04-04 13:30:27 +01:00
Stephen Finucane 96274a077a db: Remove unnecessary warning filter
Change Ie8831c04b7b4515deea27b1ceb472d07cda91ca0 replace the only users
of 'autoload' with 'autoload_with'.

Change-Id: I37bbe45d6d9ce41a3c238e33d4469f9a362491ad
2024-04-04 13:30:24 +01:00
Mike Bayer 505719a50a db: turn off autocommit
after testing using an assert for DML without a transaction,
we can now turn autocommit off.   enginefacade should be used
completely now

Change-Id: I2ee07c7e41ea43c2ab24a4a095550dd0b5fe47dd
2024-04-03 19:33:24 -04:00
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
Stephen Finucane cae5ac7be1 db: Remove final use of legacy facade
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I1251a5c0b2f073604ae61f378992fea7df51c07d
2024-04-03 16:23:12 +01:00
Stephen Finucane 98ef4c7755 db: Post-migration cleanup
Now that we have migrated all of our DB APIs to enginefacade, we can
clean up the outstanding TODOs.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Iee198a16f030f1205d38b7c232d4e3a42642c756
2024-04-03 16:23:12 +01:00
Stephen Finucane 1330a5e34a db: Remove 'get_session'
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I2a1a8b8eb933fc750ff8b3fc9d7ff1c7686625e6
2024-04-03 16:22:19 +01:00
Stephen Finucane d581714351 db: Remove session arguments from AZ methods
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I38ae324d5edb3705b559c3706d6888f08473a633
2024-04-03 11:29:58 +01:00
Stephen Finucane d74c804121 db: Migrate "share" APIs to enginefacade
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ie5035546c3d640e3558446ad082510c249d0ce65
2024-04-02 15:40:18 +01:00
Stephen Finucane f3805e2a13 db: Migrate "share snapshot metadata" APIs to enginefacade
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I3fa8e4e1e526d75051cb323702e3532d99008313
2024-04-02 15:40:18 +01:00
Stephen Finucane a55cafae8e db: Migrate "share snapshot export location" APIs to enginefacade
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I3d29b5426c5a633b5590367b56d00847215d8201
2024-04-02 15:40:07 +01:00
Stephen Finucane b8f5d6199d db: Migrate "share * access" APIs to enginefacade
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I590f4c7f78851b20a339294b820d0c223e298f3d
2024-04-02 14:12:34 +01:00
Stephen Finucane 685acf6013 db: Migrate "share snapshot", "share snapshot instance" APIs to enginefacade
Thankfully the APIs being migrated here were _mostly_ sharing sessions
already, so we can simply migrate from public (decorated) methods to
private methods with minimal fuss.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Id1b555e48106662d15e8c50567a5f3acecf6a8f1
2024-04-02 14:11:07 +01:00
Stephen Finucane 3be71e3e07 db: Unwind unnecessary independent transactions
We need to maintain these on quotas (for now) but not on other
operations.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I991d6127c14b5f06ca9ca8e6caccbc392e639b42
2024-03-25 11:32:49 +00:00
Zuul f4c77bfe71 Merge "Add cephfs filesystem to shares metadata" 2024-03-01 07:52:13 +00:00
Zuul 7b685d9dda Merge "Add a new config option to specify admin metadata" 2024-02-29 17:06:48 +00:00
Zuul 618576ff31 Merge "Add disabled reason field to service." 2024-02-28 21:27:48 +00:00
silvacarloss 7e585a3bb5 Add cephfs filesystem to shares metadata
Make use of the `get_optional_share_creation_data` driver interface
to metadata in shares' created using the cephfs protocol.

Closes-Bug: #2050010
Change-Id: I91b51f974840f593334f2dcddfcfd45adfe87780
2024-02-27 18:09:31 -03:00
haixin 12ef157c3b Add disabled reason field to service.
update micversion to 2.83
user can set disabled reason for service.

Closes-Bug: #2037700

Change-Id: I3d7c46945366ac9e1d305c2f6de2233859259bf7
2024-02-27 14:27:37 +08:00
Takashi Kajinami 696f9ea8a2 Drop reference to WalkVersionsMixin from oslo.db
The WalkVersionsMixin class was already removed from oslo.db, because
of removal of sqlalchemy-migrate support.

Change-Id: I952e0aed8705fd4fc0b89f6ee34f31da1b30c656
2024-02-26 18:50:27 +09:00
silvacarloss 3429717601 Add a new config option to specify admin metadata
- A new config option named ``admin_metadata_keys`` was introduced
and we expect it to be set in the DEFAULT section of the manila
configuration file. It is expected that administrators will provide
a list of metadata keys that can only be updated by administrators
through this configuration option.

- Drivers will be able to set metadata while creating shares
through the `get_optional_share_creation_data` driver interface.

Closes-Bug: #2050010
Change-Id: I6412710c7db89747d23033e1a5a6be9de5886b0b
2024-02-22 14:31:44 -03:00
Zuul 25d923925a Merge "is_valid_ip_address: Catch non-string values early" 2024-02-20 21:57:34 +00:00
Zuul 8ce69b1951 Merge "Conditional Import for FIPS Compliance" 2024-02-20 16:42:50 +00:00
Takashi Kajinami c3b8afc47a is_valid_ip_address: Catch non-string values early
The is_valid_ipvN methods from oslo.utils raises an exception for
non-string values, because of the change in netaddr 1.0.0. This adds
a wrapper logic to retain the previous behavior, which is preferred by
manila.

Change-Id: If1297e4d54fd645969ca79690a1c558c9efdbc8d
2024-02-20 05:33:37 +00:00
Zuul 84d10cf225 Merge "Deprecate GlusterFS (Native) Driver" 2024-02-17 06:04:10 +00:00
Zuul fbae564132 Merge "Dell EMC: Deprecate VNX driver" 2024-02-17 01:40:05 +00:00
Zuul e3aaac5bb9 Merge "Deprecate untested Tegile share driver" 2024-02-16 19:22:44 +00:00
Zuul 179a1e7a4d Merge "Dell EMC: Drop "vmax" alias" 2024-02-16 17:17:30 +00:00
Zuul 05a231e370 Merge "db: Fix charset updates in migrations" 2024-02-16 10:46:31 +00:00
Takashi Kajinami c8ed5b05e9 db: Fix charset updates in migrations
We are failing py311 jobs with our migration checks;
and the reason is that we have some 'implied' sql defaults
that might be inconsistent with the server versions - one
of them is the charset. We recently [1] fixed a bunch of
un-annotated tables with explicit charset declarations.
This is a continuation of that attempt.

Unfortunately, we can't change history. On existing
deployments, changes to these migrations will be ignored,
and must be done manually if there are any inconsistencies
to be fixed.

While we're at it, this commit also cleans up separate
steps to set the charset and engine to pre-created
tables.

[1] I7cd6fa0cc8e054af112493746e753fef2024000f
Closes-Bug: #2053211
Change-Id: I16345f63a279549e81cbde7b60fed29521d48a02
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2024-02-15 21:36:04 -08:00
Takashi Kajinami f2afe01ab9 Deprecate untested Tegile share driver
The driver was added in 2016, but it has had no 3rd party CI and it has
been untested. According to git log, the driver has not get any updates
specific to it.

Cinder already removed the Tegile driver[1] because of lack of CI.

[1] https://review.opendev.org/c/openstack/cinder/+/501333

Change-Id: I25a97ee23e5ce96ca0aec15941ad26763cd8cea0
2024-02-13 01:50:16 +00:00
Takashi Kajinami 436c89fefd Deprecate GlusterFS (Native) Driver
CI of these drivers has been broken since migration to Ubuntu Jammy
and no one has shown interest to fix it so far.

Because these drivers haven't been update for some time, we can assume
these drivers are no longer used.

Related-Bug: #1998493
Change-Id: I9df5b7289dcec3a0de321169e892512571e7c006
2024-02-13 09:47:28 +09:00
Zuul a7ffbf7bd0 Merge "tests: has_calls -> assert_has_calls" 2024-02-08 23:37:52 +00:00
James Page 51f78b8e8e
tests: has_calls -> assert_has_calls
Ensure that an assert method is actually used when validating calls
in unit tests.

This also revealed an issue with the expected calls; query updated
to reflect the use of to domain attribute in the security context.

Change-Id: I7f71437330a23a2b5f178cf1980ba23260ea4a9b
2024-02-08 09:40:12 +00:00
ashrod98 47e7c78f37 Conditional Import for FIPS Compliance
Conditionally Import Parakimo
Separate SSH functions into ssh_utils.py for safe conditional import.

Change-Id: Ia1a3ee69bef76b52e4e6df1e73488c018ac0f3c9
2024-02-06 20:30:39 +00:00
Kiran Pawar 09c51d2978 Retry on connection error to neutron
In case of keystoneauth1 ConnectError, manila will retry the neutron
API call. For create_port(), it will make sure no duplicate ports
are created.

Closes-bug: #2049507
Change-Id: I12fece58671e9fb3705e22090187c42d9c3a74d9
2024-02-06 13:58:09 +00:00
Zuul 796037ea7f Merge "Changed user message, and removed unnecessary log message" 2024-02-05 20:44:54 +00:00
Zuul a83a4b1165 Merge "api: Dump config options when deployed as a wsgi app" 2024-02-05 17:20:02 +00:00
melakualehegn b4985cb2c9 Changed user message, and removed unnecessary log message
Change-Id: I0327757007e6ca34227501fd57baedb35f15d602
2024-02-02 13:39:01 +00:00
Zuul ffff0e1dbf Merge "Fixing skipped default override for CORS options" 2024-02-01 16:52:19 +00:00
Takashi Kajinami 19a91e0558 Dell EMC: Deprecate VNX driver
... because VNX already reached its EOL.

Change-Id: I1d6b2bfd7d99295f30fd9028771c8c4e7bd6b65f
2024-02-01 02:27:41 +00:00
Takashi Kajinami aabbd02598 Dell EMC: Drop "vmax" alias
This removes support for using "vmax" backends, which was translated
to "powermax" backends. This behavior was expected to be removed during
Wallaby cycle.

Also replace the remaining reference to EMC VMAX.

Change-Id: Id1187a9a99d87abefe3549e70df768f41494145f
2024-02-01 02:27:34 +00:00