Fix directory structure
This patch creates - `blazar/api/v1/leases` - `blazar/tests/api/v1/leases` - `blazar/manager/leases` and move related files there to keep symmetric structure between oshosts and leases API. This patch also moves test_physical_host_plugin.py from `blazar/tests/plugins/` to `blazar/tests/plugins/oshosts/`. Change-Id: Ib5ae4e291a9e47459f7aeee3d7570688bd8b1648
This commit is contained in:
parent
c31dd15ac2
commit
52634f55fd
|
@ -24,9 +24,9 @@ from oslo_log import log as logging
|
|||
from oslo_middleware import debug
|
||||
from werkzeug import exceptions as werkzeug_exceptions
|
||||
|
||||
from blazar.api.v1.leases import v1_0 as leases_api_v1_0
|
||||
from blazar.api.v1.oshosts import v1_0 as host_api_v1_0
|
||||
from blazar.api.v1 import utils as api_utils
|
||||
from blazar.api.v1 import v1_0 as api_v1_0
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -69,7 +69,7 @@ def make_app():
|
|||
|
||||
app.route('/', methods=['GET'])(version_list)
|
||||
app.route('/versions', methods=['GET'])(version_list)
|
||||
app.register_blueprint(api_v1_0.rest, url_prefix='/v1')
|
||||
app.register_blueprint(leases_api_v1_0.rest, url_prefix='/v1')
|
||||
|
||||
LOG.debug("List of plugins: %s", cfg.CONF.manager.plugins)
|
||||
# TODO(sbauza) : Change this whole crap by removing hardcoded values and
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
from oslo_log import log as logging
|
||||
|
||||
from blazar import context
|
||||
from blazar.manager import rpcapi as manager_rpcapi
|
||||
from blazar.manager.leases import rpcapi as manager_rpcapi
|
||||
from blazar import policy
|
||||
from blazar.utils import trusts
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from blazar.api.v1 import service
|
||||
from blazar.api.v1.leases import service
|
||||
from blazar.api.v1 import utils as api_utils
|
||||
from blazar.api.v1 import validation
|
||||
from blazar import utils
|
|
@ -19,8 +19,8 @@ from pecan import hooks
|
|||
|
||||
from blazar.api import context
|
||||
from blazar.db import api as dbapi
|
||||
from blazar.manager.leases import rpcapi as leases_rpcapi
|
||||
from blazar.manager.oshosts import rpcapi as hosts_rpcapi
|
||||
from blazar.manager import rpcapi
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -64,5 +64,5 @@ class RPCHook(hooks.PecanHook):
|
|||
"""Attach the rpcapi object to the request so controllers can get to it."""
|
||||
|
||||
def before(self, state):
|
||||
state.request.rpcapi = rpcapi.ManagerRPCAPI()
|
||||
state.request.rpcapi = leases_rpcapi.ManagerRPCAPI()
|
||||
state.request.hosts_rpcapi = hosts_rpcapi.ManagerRPCAPI()
|
||||
|
|
|
@ -22,8 +22,8 @@ import six
|
|||
|
||||
from blazar.api import context as api_context
|
||||
from blazar import context
|
||||
from blazar.manager.leases import rpcapi as leases_api
|
||||
from blazar.manager.oshosts import rpcapi as hosts_rpcapi
|
||||
from blazar.manager import rpcapi
|
||||
from blazar import tests
|
||||
|
||||
PATH_PREFIX = '/v2'
|
||||
|
@ -65,7 +65,7 @@ class APITest(tests.TestCase):
|
|||
'ctx_from_headers')
|
||||
self.fake_ctx_from_headers.side_effect = fake_ctx_from_headers
|
||||
|
||||
self.rpcapi = rpcapi.ManagerRPCAPI
|
||||
self.rpcapi = leases_api.ManagerRPCAPI
|
||||
self.hosts_rpcapi = hosts_rpcapi.ManagerRPCAPI
|
||||
|
||||
# self.patch(rpcapi.ManagerRPCAPI, 'list_leases').return_value = []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from blazar.api.v1 import service as service_api
|
||||
from blazar.api.v1.leases import service as service_api
|
||||
from blazar import tests
|
||||
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from blazar.api.v1 import service as service_api
|
||||
from blazar.api.v1.leases import service as service_api
|
||||
from blazar.api.v1.leases import v1_0 as api
|
||||
from blazar.api.v1 import utils as utils_api
|
||||
from blazar.api.v1 import v1_0 as api
|
||||
from blazar import tests
|
||||
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from blazar.api.v1 import service as service_api
|
||||
from blazar.api.v1.leases import service as service_api
|
||||
from blazar.api.v1 import utils as api_utils
|
||||
from blazar.api.v1 import validation as validation_api
|
||||
from blazar import exceptions
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
from blazar.manager import rpcapi
|
||||
from blazar.manager.leases import rpcapi
|
||||
from blazar import tests
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue