ReproNim / reproman

ReproMan (AKA NICEMAN, AKA ReproNim TRD3)
https://reproman.readthedocs.io
Other
24 stars 14 forks source link

ls: exit with non-0 if listing of any resource has failed #521

Closed yarikoptic closed 4 years ago

yarikoptic commented 4 years ago
(git)smaug:~/proj/repronim/reproman-master[doc-usecases]git
$> git describe
v0.2.1-98-gbaab991
(dev3) 2 15077.....................................:Wed 27 May 2020 03:50:18 PM EDT:.
(git)smaug:~/proj/repronim/reproman-master[doc-usecases]git
$> reproman ls local2
RESOURCE NAME        TYPE                 ID                  STATUS    
-------------        ----                 --                  ------    
2020-05-27 15:50:23,649 [WARNING] Manager did not return a resource for local2: Resource matching local2 not found [base.py:_get_resource_config:325] 
Use --refresh option to view updated status.

$> echo $?
0

AFAIK this is the only way we could check quickly if resource is actually known to create it if needed. Otherwise we could try to create it and ignore when that fails, e.g.

reproman create -t shell local || :

but it could fail for various other reasons, not only that it already exists