@@ -269,7 +269,7 @@ def run(self, request, **kwargs):
269269 raise DryccException ("command is a required field" )
270270 volumes = request .data .get ('volumes' , None )
271271 if volumes :
272- serializers .VolumeSerializer ().validate_path (volumes )
272+ volumes = serializers .VolumeSerializer ().validate_path (volumes )
273273 rc , output = app .run (self .request .user , request .data ['command' ], volumes )
274274 return Response ({'exit_code' : rc , 'output' : str (output )})
275275
@@ -717,6 +717,8 @@ def path(self, request, *args, **kwargs):
717717 new_path = request .data .get ('path' )
718718 if new_path is None :
719719 raise DryccException ("path is a required field" )
720+ else :
721+ new_path = serializers .VolumeSerializer ().validate_path (new_path )
720722 volume = self .get_object ()
721723 container_types = [_ for _ in new_path .keys ()
722724 if _ not in volume .app .types ]
@@ -734,7 +736,7 @@ def path(self, request, *args, **kwargs):
734736 if k not in type_paths :
735737 type_paths [k ] = [v ]
736738 else :
737- type_paths [k ].append (k )
739+ type_paths [k ].append (v )
738740 repeat_path = [v for k , v in new_path .items () if v in type_paths .get (k , [])] # noqa
739741 if repeat_path :
740742 raise DryccException ("path {} is used by another volume" .
0 commit comments