Volumes and backups managers' methods are decorated with
`require_initialized_driver` which checks whether the driver has been
initialized or not. The decorator fails with a `DriverNotInitialized`
exception if the driver hasn't been initialized.
This early failure leaves volumes and backups in a wrong status which is
not just confusing for the user but it also makes it difficult to do
anything with the resources after they've been left in a 'bogus' status.
For example, when a volume creation is requested, the volume is first
created in the database and its status is set to 'creating'. Then the
scheduler will pick an available volume node and send the task to it. If
the driver has not been initialized, the volume status will be left as
'creating' instead of 'error'.
This patch fixes that issue by moving the driver initialization check
into the various manager's methods. In some cases this check is done at
the very beginning of the method, in some others - either to avoid code
duplication or because the lines above the check made sense to be
executed first - this check is done later in the method.
NOTE: Regardless the conflicts noted below, this patch should be
backported. The issue it fixes is a source of several bug reports, user
frustration and confusion. The conflicts were related to some additions
in the master branch. Resolving the conflicts was pretty
straightforward.
Reviewed: https:/ /review. openstack. org/67097 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=4228c0ebc23 7d821a8784a1dcf 165f238cddc56e
Committed: https:/
Submitter: Jenkins
Branch: stable/havana
commit 4228c0ebc237d82 1a8784a1dcf165f 238cddc56e
Author: Flavio Percoco <email address hidden>
Date: Tue Dec 10 12:31:50 2013 +0100
Move driver initialization check into the method
Volumes and backups managers' methods are decorated with initialized_ driver` which checks whether the driver has been alized`
`require_
initialized or not. The decorator fails with a `DriverNotIniti
exception if the driver hasn't been initialized.
This early failure leaves volumes and backups in a wrong status which is
not just confusing for the user but it also makes it difficult to do
anything with the resources after they've been left in a 'bogus' status.
For example, when a volume creation is requested, the volume is first
created in the database and its status is set to 'creating'. Then the
scheduler will pick an available volume node and send the task to it. If
the driver has not been initialized, the volume status will be left as
'creating' instead of 'error'.
This patch fixes that issue by moving the driver initialization check
into the various manager's methods. In some cases this check is done at
the very beginning of the method, in some others - either to avoid code
duplication or because the lines above the check made sense to be
executed first - this check is done later in the method.
NOTE: Regardless the conflicts noted below, this patch should be ward.
backported. The issue it fixes is a source of several bug reports, user
frustration and confusion. The conflicts were related to some additions
in the master branch. Resolving the conflicts was pretty
straightfor
Conflicts: tests/test_ volume. py utils.py volume/ flows/create_ volume/ __init_ _.py volume/ manager. py
cinder/
cinder/
cinder/
cinder/
Closes-bug: #1242942 8436de0e11269c8 5a095ed40b) f417f1a1f7bb27a f30273e4814
(cherry picked from commit 5be4620ae5bb50c
Change-Id: I2610be6ba1aa7d