Ticket #9594 (closed: fixed)
Prevent running Catalog algorithms if not logged in
Reported by: | Jay Rainey | Owned by: | Jay Rainey |
---|---|---|---|
Priority: | blocker | Milestone: | Release 3.2 |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | #9569 | Tester: | Keith Brown |
Description
If a user executes a catalog algorithm there is no logic to inform them if they are not logged in. Instead (currently), the algorithm outputs the default output direction, which is empty.
Instead, functionality needs to be implemented to throw a runtime if the user is not logged in, and placed in the following catalog classes:
- CatalogDownloadDataFiles.cpp
- CatalogGetDataFiles.cpp
- CatalogGetDataSets.cpp
- CatalogKeepAlive.cpp
- CatalogListInstruments.cpp
- CatalogListInvestigationTypes.cpp
- CatalogLogout.cpp
- CatalogMyDataSearch.cpp
- CatalogPublish.cpp
- CatalogSearch.cpp
To see this issue in action, run the following in Python:
from mantid.simpleapi import * # Assuming you have previously logged into the catalog. datasets = CatalogGetDataSets(InvestigationId = '1193002') # If logged in, it would return 2, otherwise 0, rather than an error! print str(len(datasets)) # Verify that we have any datafiles in the returned workspace. print "The number of datasets for this investigation is: " + str(len(datasets))
Change History
comment:2 Changed 6 years ago by Jay Rainey
Call method before executing Catalog algorithms. Refs #9594.
Changeset: f6fd0a6204899981a5eaf979189f42dc9291d2bc
comment:3 Changed 6 years ago by Jay Rainey
Revert previous two commit changes. Refs #9594.
Changeset: c3fe4ff26e194c2d759a3ae445113771c501a2cd
comment:4 Changed 6 years ago by Jay Rainey
Add check to CatalogManager instead. Refs #9594.
- This removes the dependency of all catalog algorithms on CatalogAlgorithmHelper.
Changeset: 0f2bad7859eb41f2a38cf5d9d171df05d1412dfe
comment:5 Changed 6 years ago by Jay Rainey
Forgot to remove CatalogManager from helper. Refs #9594.
Changeset: bcb975833c51034a1f21077eaf86d2e5a40bb490
comment:6 Changed 6 years ago by Jay Rainey
- Status changed from new to assigned
To test
- Run the script from the description BEFORE testing the ticket. Observe that datasets is 0, even though we are not logged into the catalog. This is incorrect!
- Run the script AFTER, and observe that an error is thrown to inform the user that they are not logged into the catalog. You will need to add CatalogLogin(YOURUSERNAME,YOURPASSWORD to the start of the script.
- Verify that the logic has been added to the top of each Catalog algorithm noted in the description.
- Perform a code review.
- Run through the catalog interface to verify it still works as expected.
comment:7 Changed 6 years ago by Jay Rainey
- Status changed from assigned to verify
- Resolution set to fixed
comment:8 Changed 6 years ago by Keith Brown
- Status changed from verify to verifying
- Tester set to Keith Brown
comment:9 Changed 6 years ago by Keith Brown
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/9594_catalog_check_if_logged_in'
Full changeset: 994c9c66a51f1e5822c42bc50813f2eb0fe45959
comment:10 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 10437
Add method to check if used is logged in to catalog. Refs #9594.
Changeset: 3a5a62449186ac499c486dc7b660229586cda9ab