File tree Expand file tree Collapse file tree
doc/source/command-objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ Set quotas for project
3030 [--gigabytes < new-gigabytes> ]
3131 [--snapshots < new-snapshots> ]
3232 [--volumes < new-volumes> ]
33+ [--volume-type < volume-type> ]
3334
3435 < project>
3536
@@ -121,6 +122,10 @@ Set quotas for class
121122
122123 New value for the snapshots quota
123124
125+ .. option :: --volume-type <volume-type >
126+
127+ Set quotas for a specific <volume-type>
128+
124129quota show
125130----------
126131
Original file line number Diff line number Diff line change @@ -82,6 +82,11 @@ def get_parser(self, prog_name):
8282 type = int ,
8383 help = 'New value for the %s quota' % v ,
8484 )
85+ parser .add_argument (
86+ '--volume-type' ,
87+ metavar = '<volume-type>' ,
88+ help = 'Set quotas for a specific <volume-type>' ,
89+ )
8590 return parser
8691
8792 def take_action (self , parsed_args ):
@@ -97,8 +102,11 @@ def take_action(self, parsed_args):
97102
98103 volume_kwargs = {}
99104 for k , v in VOLUME_QUOTAS .items ():
100- if v in parsed_args :
101- volume_kwargs [k ] = getattr (parsed_args , v , None )
105+ value = getattr (parsed_args , v , None )
106+ if value is not None :
107+ if parsed_args .volume_type :
108+ k = k + '_%s' % parsed_args .volume_type
109+ volume_kwargs [k ] = value
102110
103111 if compute_kwargs == {} and volume_kwargs == {}:
104112 sys .stderr .write ("No quotas updated" )
You can’t perform that action at this time.
0 commit comments