def get_share_networks_data(self): try: share_networks = manila.share_network_list( self.request, detailed=True, search_opts={'all_tenants': True}) if base.is_service_enabled(self.request, 'network'): neutron_net_names = dict((net.id, net.name) for net in neutron.network_list(self.request)) neutron_subnet_names = dict((net.id, net.name) for net in neutron.subnet_list(self.request)) for sn in share_networks: sn.neutron_net = neutron_net_names.get( sn.neutron_net_id) or sn.neutron_net_id or "-" sn.neutron_subnet = neutron_subnet_names.get( sn.neutron_subnet_id) or sn.neutron_subnet_id or "-" else: nova_net_names = dict( [(net.id, net.label) for net in network.network_list(self.request)]) for sn in share_networks: sn.nova_net = nova_net_names.get( sn.nova_net_id) or sn.nova_net_id or "-" except Exception: share_networks = [] exceptions.handle(self.request, _("Unable to retrieve share networks")) utils.set_tenant_name_to_objects(self.request, share_networks) return share_networks
def get_share_networks_data(self): try: share_networks = manila.share_network_list( self.request, detailed=True, search_opts={'all_tenants': True}) if base.is_service_enabled(self.request, 'network'): neutron_net_names = dict( (net.id, net.name) for net in neutron.network_list(self.request)) neutron_subnet_names = dict( (net.id, net.name) for net in neutron.subnet_list(self.request)) for sn in share_networks: sn.neutron_net = neutron_net_names.get( sn.neutron_net_id) or sn.neutron_net_id or "-" sn.neutron_subnet = neutron_subnet_names.get( sn.neutron_subnet_id) or sn.neutron_subnet_id or "-" else: nova_net_names = dict([ (net.id, net.label) for net in network.network_list(self.request) ]) for sn in share_networks: sn.nova_net = nova_net_names.get( sn.nova_net_id) or sn.nova_net_id or "-" except Exception: share_networks = [] exceptions.handle(self.request, _("Unable to retrieve share networks")) utils.set_tenant_name_to_objects(self.request, share_networks) return share_networks
def get_share_servers_data(self): try: share_servers = manila.share_server_list(self.request) except Exception: share_servers = [] exceptions.handle(self.request, _("Unable to retrieve share servers")) utils.set_tenant_name_to_objects(self.request, share_servers) return share_servers
def get_share_servers_data(self): try: share_servers = manila.share_server_list( self.request) except Exception: share_servers = [] exceptions.handle(self.request, _("Unable to retrieve share servers")) utils.set_tenant_name_to_objects(self.request, share_servers) return share_servers
def get_security_services_data(self): try: security_services = manila.security_service_list( self.request, search_opts={'all_tenants': True}) except Exception: security_services = [] exceptions.handle(self.request, _("Unable to retrieve security services")) utils.set_tenant_name_to_objects(self.request, security_services) return security_services
def get_security_services_data(self): try: security_services = manila.security_service_list( self.request, search_opts={'all_tenants': True}) except Exception: security_services = [] exceptions.handle(self.request, _("Unable to retrieve security services")) utils.set_tenant_name_to_objects(self.request, security_services) return security_services
def get_snapshots_data(self): snapshots = [] try: snapshots = manila.share_snapshot_list( self.request, search_opts={'all_tenants': True}) shares = manila.share_list(self.request) share_names = dict([(share.id, share.name or share.id) for share in shares]) for snapshot in snapshots: snapshot.share = share_names.get(snapshot.share_id) except Exception: msg = _("Unable to retrieve snapshot list.") exceptions.handle(self.request, msg) # Gather our tenants to correlate against IDs utils.set_tenant_name_to_objects(self.request, snapshots) return snapshots
def get_snapshots_data(self): snapshots = [] try: snapshots = manila.share_snapshot_list( self.request, search_opts={'all_tenants': True}) shares = manila.share_list(self.request) share_names = dict([(share.id, share.name or share.id) for share in shares]) for snapshot in snapshots: snapshot.share = share_names.get(snapshot.share_id) except Exception: msg = _("Unable to retrieve snapshot list.") exceptions.handle(self.request, msg) # Gather our tenants to correlate against IDs utils.set_tenant_name_to_objects(self.request, snapshots) return snapshots
def get_shares_data(self): shares = [] try: shares = manila.share_list(self.request, search_opts={'all_tenants': True}) snapshots = manila.share_snapshot_list( self.request, detailed=True, search_opts={'all_tenants': True}) share_ids_with_snapshots = [] for snapshot in snapshots: share_ids_with_snapshots.append(snapshot.to_dict()['share_id']) for share in shares: if share.to_dict()['id'] in share_ids_with_snapshots: setattr(share, 'has_snapshot', True) else: setattr(share, 'has_snapshot', False) except Exception: exceptions.handle(self.request, _('Unable to retrieve share list.')) # Gather our tenants to correlate against IDs utils.set_tenant_name_to_objects(self.request, shares) return shares
def get_shares_data(self): shares = [] try: shares = manila.share_list( self.request, search_opts={'all_tenants': True}) snapshots = manila.share_snapshot_list( self.request, detailed=True, search_opts={'all_tenants': True}) share_ids_with_snapshots = [] for snapshot in snapshots: share_ids_with_snapshots.append(snapshot.to_dict()['share_id']) for share in shares: if share.to_dict()['id'] in share_ids_with_snapshots: setattr(share, 'has_snapshot', True) else: setattr(share, 'has_snapshot', False) except Exception: exceptions.handle( self.request, _('Unable to retrieve share list.')) # Gather our tenants to correlate against IDs utils.set_tenant_name_to_objects(self.request, shares) return shares