def get_data(self, request, rule_id): rules = manila.share_snapshot_rules_list( request, self.table.kwargs['snapshot_id']) if rules: for rule in rules: if rule.id == rule_id: return rule raise exceptions.NotFound
def get_data(self, request, rule_id): rules = manila.share_snapshot_rules_list( request, self.table.kwargs['snapshot_id']) if rules: for rule in rules: if rule.id == rule_id: return rule raise exceptions.NotFound
def get_data(self): try: snapshot_id = self.kwargs['snapshot_id'] rules = manila.share_snapshot_rules_list(self.request, snapshot_id) except Exception: redirect = reverse('horizon:project:share_snapshots:index') exceptions.handle(self.request, _('Unable to retrieve share snapshot rules.'), redirect=redirect) return rules
def get_data(self): try: snapshot_id = self.kwargs['snapshot_id'] rules = manila.share_snapshot_rules_list( self.request, snapshot_id) except Exception: redirect = reverse('horizon:project:share_snapshots:index') exceptions.handle( self.request, _('Unable to retrieve share snapshot rules.'), redirect=redirect) return rules
def get_data(self): try: snapshot_id = self.kwargs['snapshot_id'] snapshot = manila.share_snapshot_get(self.request, snapshot_id) share = manila.share_get(self.request, snapshot.share_id) if share.mount_snapshot_support: snapshot.rules = manila.share_snapshot_rules_list( self.request, snapshot_id) snapshot.export_locations = ( manila.share_snap_export_location_list( self.request, snapshot)) export_locations = [ exp['path'] for exp in snapshot.export_locations ] snapshot.el_size = ui_utils.calculate_longest_str_size( export_locations) snapshot.share_name_or_id = share.name or share.id except Exception: exceptions.handle(self.request, _('Unable to retrieve snapshot details.'), redirect=self.redirect_url) return snapshot
def get_data(self): try: snapshot_id = self.kwargs['snapshot_id'] snapshot = manila.share_snapshot_get(self.request, snapshot_id) share = manila.share_get(self.request, snapshot.share_id) if share.mount_snapshot_support: snapshot.rules = manila.share_snapshot_rules_list( self.request, snapshot_id) snapshot.export_locations = ( manila.share_snap_export_location_list( self.request, snapshot)) export_locations = [ exp['path'] for exp in snapshot.export_locations ] snapshot.el_size = ui_utils.calculate_longest_str_size( export_locations) snapshot.share_name_or_id = share.name or share.id except Exception: exceptions.handle( self.request, _('Unable to retrieve snapshot details.'), redirect=self.redirect_url) return snapshot
def test_list_snapshot_rules(self): api.share_snapshot_rules_list(self.request, self.id) client = self.manilaclient client.share_snapshots.access_list.assert_called_once_with(self.id)
def test_list_snapshot_rules(self): api.share_snapshot_rules_list(self.request, self.id) client = self.manilaclient client.share_snapshots.access_list.assert_called_once_with(self.id)