示例#1
0
    def setUp(self):
        super(CinderApiTestCase, self).setUp()

        self.api = cinder.API()
        self.cinderclient = FakeCinderClient()
        self.ctx = context.get_admin_context()
        self.mox.StubOutWithMock(cinder, 'cinderclient')
        self.mox.StubOutWithMock(cinder, '_untranslate_volume_summary_view')
        self.mox.StubOutWithMock(cinder, '_untranslate_snapshot_summary_view')
示例#2
0
    def setUp(self):
        super(BaseCinderTestCase, self).setUp()
        cinder.reset_globals()
        self.requests = self.useFixture(fixture.Fixture())
        self.api = cinder.API()

        self.context = context.RequestContext('username',
                                              'project_id',
                                              auth_token='token',
                                              service_catalog=self.CATALOG)
示例#3
0
    def setUp(self):
        super(CinderTestCase, self).setUp()
        catalog = [{
            "type": "volume",
            "name": "cinder",
            "endpoints": [{"publicURL": "http://localhost:8776/v1/project_id"}]
        }]
        self.context = context.RequestContext('username', 'project_id',
                                              service_catalog=catalog)
        cinder.cinderclient(self.context)

        self.api = cinder.API()
示例#4
0
 def setUp(self):
     super(CinderTestCase, self).setUp()
     self.fake_client_factory = FakeClientFactory()
     self.stubs.Set(cinder.cinder_client, "Client",
                    self.fake_client_factory)
     self.api = cinder.API()
     catalog = [{
         "type": "volume",
         "name": "cinder",
         "endpoints": [{"publicURL": "http://localhost:8776/v1/project_id"}]
     }]
     self.context = context.RequestContext('username', 'project_id',
                                           service_catalog=catalog)
示例#5
0
    def setUp(self):
        super(CinderV2TestCase, self).setUp()
        catalog = [{
            "type": "volumev2",
            "name": "cinderv2",
            "endpoints": [{"publicURL": "http://localhost:8776/v2/project_id"}]
        }]
        cinder.CONF.set_override('cinder_catalog_info',
                                 'volumev2:cinder:publicURL')
        self.context = context.RequestContext('username', 'project_id',
                                              service_catalog=catalog)

        cinder.cinderclient(self.context)
        self.api = cinder.API()
示例#6
0
    def __init__(self, context, instance, flavor, request_spec,
                 source_migration, compute_rpcapi, host_selection,
                 alternate_hosts):
        """Construct the CrossCellMigrationTask instance

        :param context: The user request auth context. This should be targeted
            to the source cell in which the instance is currently running.
        :param instance: The instance being migrated (from the source cell)
        :param flavor: The new flavor if performing resize and not just a
            cold migration
        :param request_spec: nova.objects.RequestSpec with scheduling details
        :param source_migration: nova.objects.Migration record for this
            operation (from the source cell)
        :param compute_rpcapi: instance of nova.compute.rpcapi.ComputeAPI
        :param host_selection: nova.objects.Selection of the initial
            selected target host from the scheduler where the selected host
            is in another cell which is different from the cell in which
            the instance is currently running
        :param alternate_hosts: list of 0 or more nova.objects.Selection
            objects representing alternate hosts within the same target cell
            as ``host_selection``.
        """
        super(CrossCellMigrationTask, self).__init__(context, instance)
        self.request_spec = request_spec
        self.flavor = flavor
        self.source_migration = source_migration
        self.compute_rpcapi = compute_rpcapi
        self.host_selection = host_selection
        self.alternate_hosts = alternate_hosts

        self._target_cell_instance = None
        self._target_cell_context = None

        self.network_api = network.API()
        self.volume_api = cinder.API()
        self.image_api = nova_image.API()

        # Keep an ordered dict of the sub-tasks completed so we can call their
        # rollback routines if something fails.
        self._completed_tasks = collections.OrderedDict()
    def __init__(self, virtapi):
        super(AzureDriver, self).__init__(virtapi)
        try:
            self.azure = Azure()
            self.disks = self.azure.compute.disks
            self.images = self.azure.compute.images
        except Exception as e:
            msg = (_LI("Initialize Azure Adapter failed. reason: %"),
                   six.text_type(e))
            LOG.error(msg)
            raise nova_ex.NovaException(message=msg)
        self.compute = self.azure.compute
        self.network = self.azure.network
        # self.storage = self.azure.storage
        self.resource = self.azure.resource
        # self.blob = self.azure.blob

        self._volume_api = cinder.API()
        self._image_api = image.API()

        self.cleanup_time = time.time()
        self.residual_nics = []
示例#8
0
 def __init__(self):
     self.volume_api = cinder.API()
     super(VolumeController, self).__init__()
示例#9
0
 def __init__(self):
     self.compute_api = compute.API()
     self.volume_api = cinder.API()
     super(VolumeAttachmentController, self).__init__()
示例#10
0
    def setUp(self):
        super(CinderApiTestCase, self).setUp()

        self.api = cinder.API()
        self.ctx = context.get_admin_context()
示例#11
0
 def __init__(self):
     self.cinder_api = cinder.API()
     self.network_api = networkapi.API()
     self.aggregate_api = api.AggregateAPI()
     #self.api_version_request = api_version_request.APIVersionRequest()
     super(MonitorstatusController, self).__init__()
示例#12
0
 def __init__(self, fc_client, task_ops):
     super(VolumeOps, self).__init__(fc_client, task_ops)
     self._volume_api = cinder.API()