"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "openstack_dashboard/dashboards/project/key_pairs/views.py" between
horizon-22.1.0.tar.gz and horizon-23.0.0.tar.gz

About: OpenStack Horizon (Optional Service: Dashboard) provides a web-based self-service portal to interact with underlying OpenStack services, such as launching an instance, assigning IP addresses and configuring access controls.
The "Zed" series (latest release).

views.py  (horizon-22.1.0):views.py  (horizon-23.0.0)
skipping to change at line 15 skipping to change at line 15
# a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import logging
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import messages from horizon import messages
from horizon import tables from horizon import tables
from horizon.utils import memoized from horizon.utils import memoized
from horizon import views from horizon import views
from openstack_dashboard.api import nova from openstack_dashboard.api import nova
from openstack_dashboard.dashboards.project.key_pairs \ from openstack_dashboard.dashboards.project.key_pairs \
import forms as key_pairs_forms import forms as key_pairs_forms
from openstack_dashboard.dashboards.project.key_pairs \ from openstack_dashboard.dashboards.project.key_pairs \
import tables as key_pairs_tables import tables as key_pairs_tables
from openstack_dashboard import policy from openstack_dashboard import policy
LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):
table_class = key_pairs_tables.KeyPairsTable table_class = key_pairs_tables.KeyPairsTable
page_title = _("Key Pairs") page_title = _("Key Pairs")
def __init__(self):
super().__init__()
LOG.warning('The Django version of the Key Pairs panel is deprecated '
'since Zed release. Switch to the AngularJS version by '
'setting "ANGULAR_FEATURES[\'key_pairs_panel\'] = True".')
def get_data(self): def get_data(self):
if not policy.check( if not policy.check(
(("compute", "os_compute_api:os-keypairs:index"),), (("compute", "os_compute_api:os-keypairs:index"),),
self.request): self.request):
msg = _("Insufficient privilege level to retrieve key pair list.") msg = _("Insufficient privilege level to retrieve key pair list.")
messages.info(self.request, msg) messages.info(self.request, msg)
return [] return []
try: try:
keypairs = nova.keypair_list(self.request) keypairs = nova.keypair_list(self.request)
except Exception: except Exception:
 End of changes. 3 change blocks. 
0 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)