Task #11371 (closed)
Bug: delete in ScriptService deletes more than it should
Reported by: | cblackburn | Owned by: | mtbcarroll |
---|---|---|---|
Priority: | blocker | Milestone: | OMERO-4.4.9 |
Component: | Scripting | Version: | 4.4.8 |
Keywords: | n.a. | Cc: | hflynn, wmoore, jburel |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | n.a. |
Description
The following code shows that delete() in ScriptService deletes all scripts within a folder and the enclosing folder. This can lead to the deletion of all scripts. I have not tested if this is present in 5.0.
jrs-macbookpro-25031:ome cblackburn$ ls dist/lib/scripts/omero/ export_scripts/ figure_scripts/ import_scripts/ setup_scripts/ util_scripts/ >>> import omero >>> c = omero.client() >>> sf = c.createSession("root","omero") >>> ss = sf.getScriptService() >>> scripts = ss.getScripts() >>> for scr in scripts: ... print scr.id.val, scr.name.val ... 54 Batch_Image_Export.py 55 Make_Movie.py 56 Movie_Figure.py 57 Movie_ROI_Figure.py 58 ROI_Split_Figure.py 59 Split_View_Figure.py 60 Thumbnail_Figure.py 61 Populate_ROI.py 62 FLIM_initialise.py 63 Channel_Offsets.py 64 Combine_Images.py 65 Dataset_To_Plate.py 66 Images_From_ROIs.py >>> ss.deleteScript(60) >>> scripts = ss.getScripts() >>> for scr in scripts: ... print scr.id.val, scr.name.val ... 54 Batch_Image_Export.py 55 Make_Movie.py 61 Populate_ROI.py 62 FLIM_initialise.py 63 Channel_Offsets.py 64 Combine_Images.py 65 Dataset_To_Plate.py 66 Images_From_ROIs.py jrs-macbookpro-25031:ome cblackburn$ ls dist/lib/scripts/omero/ export_scripts import_scripts setup_scripts util_scripts
Change History (6)
comment:1 Changed 11 years ago by mtbcarroll
- Owner changed from jamoore to mtbcarroll
comment:2 Changed 11 years ago by mtbcarroll
- Status changed from new to accepted
comment:3 Changed 11 years ago by mtbcarroll
- Resolution set to fixed
- Status changed from accepted to closed
comment:4 Changed 11 years ago by jamoore
- Cc hflynn wmoore jburel added
- Priority changed from critical to blocker
Raising the priority post-mortem and CC'ing a few folks to just make sure we're aware of this. If I understand it right, it means that had anyone tried to use bin/omero script delete ... they would have deleted the entire directory of scripts. Perhaps worth mentioning in the release notes (or we assume since no one has complained....)
comment:5 Changed 11 years ago by Mark Carroll <m.t.b.carroll@…>
- Remaining Time set to 0
(In [25ea799d962d02d0eed9ed3f0aaa6cd860711ad2/ome.git] on branch develop) fix #11371: delete script instead of whole script directory
comment:6 Changed 11 years ago by Josh Moore <josh@…>
(In [5bc6031ab1793a7675df6b07b6fb684743747e08/ome.git] on branch develop) Merge pull request #1448 from mtbc/rebased/develop/delete-script-11371
fix #11371: adjust script delete to target specific script file name (rebased onto develop)
fixed by https://github.com/openmicroscopy/openmicroscopy/pull/1436
(thanks for a great explanation of how to see the bug!)