<s> from django . utils . translation import ugettext_lazy as _ <EOL> from horizon import exceptions <EOL> from horizon import tables <EOL> from openstack_dashboard . api import cinder <EOL> from openstack_dashboard . api import keystone <EOL> from openstack_dashboard . dashboards . project . volumes . snapshots import tables as snapshots_tables <EOL> from openstack_dashboard . dashboards . project . volumes . volumes import tables as volumes_tables <EOL> class UpdateVolumeSnapshotStatus ( tables . LinkAction ) : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> url = "<STR_LIT>" <EOL> classes = ( "<STR_LIT>" , ) <EOL> icon = "<STR_LIT>" <EOL> policy_rules = ( ( "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) , ) <EOL> class UpdateRow ( tables . Row ) : <EOL> ajax = True <EOL> def get_data ( self , request , snapshot_id ) : <EOL> snapshot = cinder . volume_snapshot_get ( request , snapshot_id ) <EOL> snapshot . _volume = cinder . volume_get ( request , snapshot . volume_id ) <EOL> snapshot . host_name = getattr ( snapshot . _volume , <EOL> '<STR_LIT>' ) <EOL> tenant_id = getattr ( snapshot . _volume , <EOL> '<STR_LIT>' ) <EOL> try : <EOL> tenant = keystone . tenant_get ( request , tenant_id ) <EOL> snapshot . tenant_name = getattr ( tenant , "<STR_LIT:name>" ) <EOL> except Exception : <EOL> msg = _ ( '<STR_LIT>' ) <EOL> exceptions . handle ( request , msg ) <EOL> return snapshot <EOL> class VolumeSnapshotsTable ( volumes_tables . VolumesTableBase ) : <EOL> name = tables . Column ( "<STR_LIT:name>" , verbose_name = _ ( "<STR_LIT:Name>" ) , <EOL> link = "<STR_LIT>" ) <EOL> volume_name = snapshots_tables . SnapshotVolumeNameColumn ( <EOL> "<STR_LIT:name>" , verbose_name = _ ( "<STR_LIT>" ) , <EOL> link = "<STR_LIT>" ) <EOL> host = tables . Column ( "<STR_LIT>" , verbose_name = _ ( "<STR_LIT>" ) ) <EOL> tenant = tables . Column ( "<STR_LIT>" , verbose_name = _ ( "<STR_LIT>" ) ) <EOL> class Meta : <EOL> name = "<STR_LIT>" <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> table_actions = ( snapshots_tables . DeleteVolumeSnapshot , ) <EOL> row_actions = ( snapshots_tables . DeleteVolumeSnapshot , <EOL> UpdateVolumeSnapshotStatus , ) <EOL> row_class = UpdateRow <EOL> status_columns = ( "<STR_LIT:status>" , ) <EOL> columns = ( '<STR_LIT>' , '<STR_LIT:host>' , '<STR_LIT:name>' , '<STR_LIT:description>' , '<STR_LIT:size>' , '<STR_LIT:status>' , <EOL> '<STR_LIT>' , ) </s>
