Ejemplo n.º 1
0
def instance_volumes_list(request, instance_id):
    volumes = _nova.novaclient(request).volumes.get_server_volumes(instance_id)

    for volume in volumes:
        volume_data = cinder.cinderclient(request).volumes.get(volume.id)
        volume.name = cinder.Volume(volume_data).name

    return volumes
Ejemplo n.º 2
0
def instance_volumes_list(request, instance_id):
    volumes = _nova.novaclient(request).volumes.get_server_volumes(instance_id)

    for volume in volumes:
        volume_data = cinder.cinderclient(request).volumes.get(volume.id)
        volume.name = cinder.Volume(volume_data).name

    return volumes
Ejemplo n.º 3
0
def instance_volumes_list(request, instance_id):
    from openstack_dashboard.api import cinder

    volumes = novaclient(request).volumes.get_server_volumes(instance_id)

    for volume in volumes:
        volume_data = cinder.cinderclient(request).volumes.get(volume.id)
        volume.name = cinder.Volume(volume_data).name

    return volumes
Ejemplo n.º 4
0
def instance_volumes_list(request, instance_id):
    from openstack_dashboard.api.cinder import cinderclient  # noqa

    volumes = novaclient(request).volumes.get_server_volumes(instance_id)

    for volume in volumes:
        volume_data = cinderclient(request).volumes.get(volume.id)
        volume.name = volume_data.display_name

    return volumes
Ejemplo n.º 5
0
def instance_volumes_list(request, instance_id):
    from openstack_dashboard.api.cinder import cinderclient

    volumes = novaclient(request).volumes.get_server_volumes(instance_id)

    for volume in volumes:
        volume_data = cinderclient(request).volumes.get(volume.id)
        volume.name = volume_data.display_name

    return volumes
Ejemplo n.º 6
0
def instance_volumes_list(request, instance_id):
    from openstack_dashboard.api import cinder

    volumes = novaclient(request).volumes.get_server_volumes(instance_id)

    for volume in volumes:
        volume_data = cinder.cinderclient(request).volumes.get(volume.id)
        volume.name = cinder.Volume(volume_data).name
        volume.size = cinder.Volume(volume_data).size
    return volumes
Ejemplo n.º 7
0
 def update(self, request, **kwargs):
     no_root = self.filter.pop('no_root', False)
     vols = cinder.cinderclient(request).volumes.list(search_opts=self.filter)
     if no_root:
         f_vols = []
         for vol in vols:
             if vol.bootable != 'true':
                 f_vols.append(vol)
             else:
                 for attach in vol.attachments:
                     if attach['device'] not in ['/dev/vda', '/dev/sda']:
                         f_vols.append(vol)
         vols = f_vols
     self.choices = [(vol.id, '{0}({1})'.format(vol.id, vol.name.encode('utf-8'))) for vol in vols]
     if vols:
         self.choices.insert(0, ('', _('Select Volume')))
     else:
         self.choices.insert(0, ('', _('No volume available')))