#NEWLINE# def get_quota_name( quota ) : #NEWLINE# #INDENT# QUOTA_NAMES = { #NEWLINE# #INDENT# 'injected_file_content_bytes' : _ ( 'Injected File Content Bytes' ) , #NEWLINE# 'injected_file_path_bytes' : _ ( 'Length of Injected File Path' ) , #NEWLINE# 'metadata_items' : _ ( 'Metadata Items' ) , #NEWLINE# 'cores' : _ ( 'VCPUs' ) , #NEWLINE# 'instances' : _ ( 'Instances' ) , #NEWLINE# 'injected_files' : _ ( 'Injected Files' ) , #NEWLINE# 'volumes' : _ ( 'Volumes' ) , #NEWLINE# 'snapshots' : _ ( 'Volume Snapshots' ) , #NEWLINE# 'gigabytes' : _ ( 'Total Size of Volumes and Snapshots (GiB)' ) , #NEWLINE# 'ram' : _ ( 'RAM (MB)' ) , #NEWLINE# 'floating_ips' : _ ( 'Floating IPs' ) , #NEWLINE# 'security_groups' : _ ( 'Security Groups' ) , #NEWLINE# 'security_group_rules' : _ ( 'Security Group Rules' ) , #NEWLINE# 'key_pairs' : _ ( 'Key Pairs' ) , #NEWLINE# 'fixed_ips' : _ ( 'Fixed IPs' ) , #NEWLINE# 'dm-crypt' : _ ( 'dm-crypt' ) , #NEWLINE# 'server_group_members' : _ ( 'Server Group Members' ) , #NEWLINE# 'server_groups' : _ ( 'Server Groups' ) , #NEWLINE# 'backup_gigabytes' : _ ( 'Backup Size (GiB)' ) , #NEWLINE# 'backups' : _ ( 'Backups' ) , #NEWLINE# 'per_volume_gigabytes' : _ ( 'Per Volume Size (GiB)' ) , #NEWLINE# #UNINDENT# } #NEWLINE# QUOTA_DYNAMIC_NAMES = { #NEWLINE# #INDENT# 'volumes' : _ ( 'Volumes of Type %(type)s' ) , #NEWLINE# 'snapshots' : _ ( 'Volume Snapshots of Type %(type)s' ) , #NEWLINE# 'gigabytes' : _ ( 'Total Size of Volumes and Snapshots (GiB) of Type %(type)s' ) , #NEWLINE# #UNINDENT# } #NEWLINE# if quota . name . startswith ( ( 'volumes_' , 'snapshots_' , 'gigabytes_' ) ) : #NEWLINE# #INDENT# params = { #NEWLINE# #INDENT# 'type' : quota . name . split ( '_' ) [ 1 ] , #NEWLINE# #UNINDENT# } #NEWLINE# return ( QUOTA_DYNAMIC_NAMES . get ( quota . name . split ( '_' ) [ 0 ] ) % params ) #NEWLINE# #UNINDENT# return QUOTA_NAMES . get ( quota . name , quota . name . replace ( '_' , ' ' ) . title ( ) )