Commit Graph

31 Commits

Author SHA1 Message Date
Tom Barron b213a25c44 Remove NovaNetworkPlugin
Nova network was deprecated in Newton and is no longer supported for
regular deployments in Ocata [1].

Complete the removal of nova network support from manila begun in [2]
by removing support for ''nova_net_id`` in the share networks API,
by removing the corresponding column from the share networks DB model,
and by removing the nova network plugins themselves.  Unit tests for
share network api views were refactored to remove redundancy while
extending coverage to the new microversion introduced with this patch
and maintaining full coverage of earlier microversions.

APIImpact
DocImpact
UpgradeImpact

Partially-implements: bp remove-nova-net-plugin

[1] http://docs.openstack.org/releasenotes/nova/unreleased.html
[2] I846b760fa7c01f7f86768399a2bfad9ced7e57cd

Change-Id: I8b9a559fbea61979f01737ed1dc272276c4f1269
2017-01-13 08:11:16 -05:00
zzxwill fb44a0a49e Put all imports from manila.i18n in one line
Put '_', '_LW', '_LI', '_LE' from manila.i18n in one line
to make it beautify. Nova, neutron and many other projects
follow this rule. Like
bc5035343d/nova/virt/disk/mount/nbd.py
ee42af1011/neutron/cmd/ipset_cleanup.py
(added more files)

Change-Id: If7ed442ebe946b32b3234ce37b38ee3a5ccbcb39
2016-09-14 06:07:33 +00:00
Jay Xu d98222a654 Add gateway in network_info and share network API
Get gateway information from network plugin and put it into network_info.
It is required by EMC Unity storage to create a interface.

APIImpact
DocImpact

Change-Id: I8614b8686af7fa5764b49e8e3cb4a4855dc3a5f4
Implements: blueprint add-gateway-info
2016-06-30 12:08:12 -04:00
Tom Patzig 8d3e72f8b2 Update quota of proper user on resource delete
When deleting a resource (share, snapshot, share-network) the quota
usage of the current user gets updated, which might not be the same
user, who created that resource. That means the quota usage will never
be reduced for initial user.
This fix adds the resources user_id to the quota update statements, to
update the quota_usage for the user, that created this resource,
irregardless who deletes it.

Change-Id: Iefe8f4d0e7c526e3ed94c1994ba62f1a2a929ba2
Closes-Bug: #1542598
2016-03-11 12:55:44 +01:00
ting.wang 2bc625399f Using dict.items() is better than six.iteritems(dict)
Replacing dict.iteritems()/.itervalues() with
six.iteritems(dict)/six.itervalues(dict) was preferred in the past,
but there was a discussion suggesting to avoid six for this[1].
The overhead of creating a temporary list on Python 2 is negligible.

[1]http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Partially-implements blueprint py3-compatibility

Change-Id: Ia2298733188b3d964d43a547504ede2ebeaba9bd
2016-01-19 22:22:48 +08:00
huayue 44fc3021d4 Replace deprecated [logger/LOG].warn with warning
Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning, so we
prefer to use warning to avoid DeprecationWarning.

Change-Id: I6b09f67bb63fbdf31903ec175db012fc50e87f16
Closes-Bug: 1508442
2016-01-08 10:32:47 +08:00
Alex Meade 680fd50d3e Add Consistency Groups API
This patch adds the /consistency-groups and /cgsnapshots
endpoints as well as AdminActions for both.

Partially implements bp manila-consistency-groups

APIImpact

Change-Id: I5fd0d3341766fdba4d92f4a43c3d1186e7a4b38e
2015-09-05 18:21:17 -04:00
Igor Malinovskiy f5f36e3bfc Add share instances and snapshot instances
Introduce new Manila core concepts:
- share instance
- snapshot instance

This is minimalistic commit which assumes that
share and snapshot can have only one instance.
More complicated logic will be implemented in
the scope of share migration and replication
features.

Partially implements bp share-instances
Change-Id: I326c00b8252f2630e72bb0c22ca294f79feee2be
2015-08-19 09:30:55 +00:00
Igor Malinovskiy a26824818f Remove Limited XML API Support from Manila
Remove the broken XML support presently available in Manila
in order to comply with the general direction among other
OpenStack projects to support JSON only.

Change-Id: Ibb542fa223f7f7d1bf95f3d1f568987ef839cd12
Closes-Bug: #1440782
2015-04-13 15:43:47 +03:00
Valeriy Ponomaryov 6bdeb63c3b Always allow delete share-network when no shares exist
Currently tenants are unable to delete share_networks if there are existing
share_servers. This doesn't make sense, because the share_server exists only
for the share_network, and if the tenant is done with the share_network,
then the share_server can go away safely.

Change-Id: I8925f3deba64da6b011516163e5554b8134c8c0a
Closes-Bug: #1429123
2015-03-10 00:23:30 +02:00
Valeriy Ponomaryov 5b68c0625b Add support of nova network for share-networks API and DB
We need support of Nova network in API and DB first, before addon of support
of it for drivers.

Changes:
- Extend ShareNetwork model with column 'nova_net_id'
- Add migration with addon of column 'nova_net_id' to ShareNetwork model
- Add support of new key 'nova_net_id' to the API of share networks
- Make it mutually exclusive with Neutron network data

Implements nova-network-api-support
Change-Id: I1b04a74aec6aed1b9bbf6e4deebee726bd0830c2
2015-02-16 14:41:00 +02:00
Valeriy Ponomaryov 63a0504c21 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.
So, start using oslo_log, but keep oslo-incubator code yet other common modules
within Manila codebase use it.

Implements bp use-oslo-log-lib

Change-Id: I88224f7c2bd99adb78140dfc3fa73cea437f29cd
2015-02-08 10:42:40 +00:00
Thomas Bechtold 071d0b59c1 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
oslo.messaging is the only exception because this package doesn't
currently support non-namespaced imports.

Change-Id: I3987e651bc880c8ffa7c0105df0298679dcd3a43
2015-01-27 09:19:50 +01:00
Andreas Jaeger 15641fba88 Convert files to use _LE and friends
LOG.warn etc. should be translated separately and thus messages need to
be marked with _LW for LOG.warn, _LI for LOG.info and _LE for LOG.errors
and LOG.exception.

Mark all LOG invocations with proper translation marker.

Use ',' instead of '%' when adding variables to log messages to allow
lazy evaluation.

Add new hacking checks for these.

Change-Id: I31d3ee50f30c63d7d647b1c2b1eae50bf96f0c74
2014-10-31 09:47:59 +01:00
Julia Varlamova 6c04272429 Improve share-network list API filtering
Add filtering share-network list by creation date, associated security
service ID, project ID (for admin context only).

Limit share network list using 'offset' and 'limit' options.

Add policy rule for 'get_all_share_networks' action.

Remove 'status' field from returned share nerwork's view,
as share_network model doesn't have such attribute. So, None was always
returned as a status.

Fix DB api function share_network_get_all_by_security_service - second param
should be named 'security_service_id' instead of 'share_network_id'.

Add unit and tempest tests.

Implements bp improve-share-network-list-filtering

Change-Id: I7c3e44068fb39672d1d6c9e06527fde2604672a9
2014-10-30 09:56:18 +04:00
Andreas Jaeger 7b659fc4e0 Use oslo.i18n
oslo.i18n provides the i18n function that were provided by
oslo-incubator's gettextutils module

Import _ where needed, oslo.i18n deprecated the builtin method.

Closes-Bug: #1382187
Change-Id: I12aa1c725aa4bb52a9aa46e9c3d2b303839de48b
2014-10-19 19:21:03 +02:00
Andreas Jaeger 732ccbc661 Use six instead of str for exceptions
Use six.text_type instead of str for exceptions to allow lazy
translations with oslo.i18n.

Remove some unneeded msg assignment.

Change-Id: Ie26c2b90503f130f69444cfb51bf5cef8f592f98
2014-10-19 19:16:21 +02:00
Julia Varlamova 0f5b706592 Don't allow security service to be updated if used
When we attach security service to share network and create
share server associated with this share network, security service
or share-network should not be updated as well as deleted.

For update should be available only 'name' and 'description' fields.

Don't allow to remove assigned security-service from share-network
when share-servers exist.

Add unit and tempest tests.

Change-Id: Ide82edea355030b281dc709f8545abfd0fcd13fb
Closes-bug: #1357355
2014-09-10 09:42:32 +04:00
Andreas Jaeger 5b76212da4 Fix some LOG invocations and messages
LOG.xxx("Hello %s" % xyz) should be LOG.xxx("Hello %s", xyz).
This allows the logging package to skip creating the
formatted log message if the message is not going to be emitted because
of the current log level.

The change touches error, warning and info LOG messages.

Adjust test suite for the above change since LOG now uses two parameters
instead of one.

Fix grammar, add missing "." to log messages in some places.

Change-Id: I86404c34502f07ed6dbda1c82b13db888c60f074
2014-09-03 07:03:00 +02:00
Julia Varlamova 4f17b8d837 Forbid to attach security services with same type to share network
Manila should not allow attach several security services
with same type to a share network, for example, two LDAPs
or two Active Directory services.

Add unit tests and fix tempest tests.

Closes-bug: #1358652

Change-Id: Id37e986e537941fe8f9086b8b150d6073c97d1ed
2014-08-27 15:02:44 +04:00
Andreas Jaeger 9154f3e55b Flake8: Fix E126 and E127
Fix these issues and enable E126 and E127:
E126 continuation line over-indented for hanging indent
E127 continuation line over-indented for visual indent

Also fix a few occurences in the touched files of:
E128 continuation line under-indented for visual indent
H405  multi line docstring summary not separated with an empty line

Partial-Bug: #1333290
Change-Id: If822401fc7e1db49d595a0736a0dff8e00dfd217
2014-08-23 08:43:02 +00:00
Andreas Jaeger 290769f087 Flake8: Fix F401
Fix:
F401 'XXX' imported but unused
Add noqa where needed, remove extra imports otherwise.

Remove F401 from ignore list.

Partial-Bug: #1333290
Change-Id: Ib71f0dd001c4e4899200b5e60b3a38e4a6c40555
2014-08-23 08:42:36 +00:00
Andreas Jaeger 09b1917fe8 Fix pep8 F811 and F812
Fixes:
manila/scheduler/simple.py:74:45: F812 list comprehension redefines
  'service' from line 59
manila/api/v1/share_networks.py:147:41: F811 redefinition of unused
  'network' from line 29

Do not blacklist these tests anymore.

Partial-Bug: #1333290
Change-Id: Ibf3c170ada17a7af0708331331bc435942c3763b
2014-08-15 15:36:51 +02:00
Julia Varlamova f1f8ca0ad1 Use oslo.db in manila
Use oslo.db library instead of own implementation.

Oslo.db code contains different utils for work with db api, db session,
migrations, test classes for db testing, tools for automatic retry
db.api query if db connection was lost, etc.

Oslo.db code was tested better as it is currently used in many projects,
there will be no need in testing our own implementation.

In many cases our own implementation of work with db duplicates
oslo.db code.

Remove:
- manila/common/sqlalchemyutils.py;
- manila/db/sqlalchemy/utils.py;
- manila/db/sqlalchemy/session.py;
- manila/db/sqlalchemy/migration.py;
- DBError, wrap_db_error, InvalidUnicodeParameter exceptions;
- db_sync, db_version, db_version_control, _find_migrate_repo
function

and replace it with appropriate oslo.db functions.

Add 'joinedload' statement to db queries if necessary.

Fix unit tests, clean up test_migrations.py

Implements bp oslo.db

Change-Id: I48a4da797594cf020f67f78024bd0f86b5abd5ef
2014-07-23 16:26:14 +04:00
Valeriy Ponomaryov ed197a5f10 py33: use six.iteritems for item iterations (part1)
Partially-implements blueprint py3-compatibility

Change-Id: I0c3356cbaefeb77b6543711d79c370b3f1032683
2014-07-07 12:30:30 -04:00
Yulia Portnova 2c7595a386 Share servers implementation
Change-Id: I90664235237e25190191a4499e513a9fe589b855
2014-05-20 13:10:43 +03:00
vponomaryov 4c6bae0e68 Added quota for share-networks
Partially-implements bp quota-for-share-networks

Change-Id: I4283626c4f25b43ea62514b792cbd14afe133e74
2014-03-25 17:55:58 +02:00
Aleks Chirko 90cb627f9e Add share network activate and deactivate
Add activation and deactivation requests
handling into share networks API.

Implements bp: share-network-activation-api

Change-Id: Ifadda82b279de3bcf31967a28bd8356e12c64d63
2014-03-10 10:18:56 +02:00
vponomaryov 075f707530 Add detail filter for share-network-list
Change-Id: Ia22f991d38b40f65618873ef5fc7e7fbdb07706f
Closes-Bug: 1282069
2014-02-26 15:41:05 +02:00
Aleks Chirko 9ae134954f Add policy checks in share networks API
Add sample policy configuration for share
network API.
Closes-Bug: #1271943

Change-Id: I77aad91014d7c0ef125192bddeae7aafaaed3aef
2014-02-05 16:51:48 +02:00
Aleks Chirko c81ad66e7e Add share's networks API
Add server side for share's networks. Implemented controller
will carry user requests to the DB and thus will allow
user to manage share's networks data.

Add share's networks support to the share API.

Partially implements bp: join-tenant-network

Change-Id: Ie4f3945255a049e80083f08a39d7f703a5c75c5e
2014-01-23 13:01:27 +02:00