File tree Expand file tree Collapse file tree
openstackclient/volume/v3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -764,18 +764,24 @@ def take_action(self, parsed_args):
764764 _ ("New size must be greater than %s GB" ) % volume .size
765765 )
766766 raise exceptions .CommandError (msg )
767- if (
768- volume .status != 'available'
769- and not volume_client .api_version .matches ('3.42' )
770- ):
767+ if volume .status not in ('available' , 'in-use' ):
771768 msg = (
772769 _ (
773770 "Volume is in %s state, it must be available "
774- "before size can be extended"
771+ "or in-use before size can be extended. "
775772 )
776773 % volume .status
777774 )
778775 raise exceptions .CommandError (msg )
776+ if (
777+ volume .status == 'in-use'
778+ and not volume_client .api_version .matches ('3.42' )
779+ ):
780+ msg = _ (
781+ "--os-volume-api-version 3.42 or greater is "
782+ "required to extend in-use volumes."
783+ )
784+ raise exceptions .CommandError (msg )
779785 volume_client .volumes .extend (volume .id , parsed_args .size )
780786 except Exception as e :
781787 LOG .error (_ ("Failed to set volume size: %s" ), e )
You can’t perform that action at this time.
0 commit comments