Skip to content

Commit da24a51

Browse files
committed
Fix the store query during promotion
1 parent 912ee2c commit da24a51

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

addons/promote/common/src/main/java/org/commonjava/indy/promote/data/PromotionHelper.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.commonjava.indy.promote.model.PathsPromoteRequest;
3030
import org.commonjava.indy.promote.model.PathsPromoteResult;
3131
import org.commonjava.indy.promote.validate.PromotionValidationException;
32+
import org.commonjava.indy.util.ApplicationStatus;
3233
import org.commonjava.indy.util.LocationUtils;
3334
import org.commonjava.maven.galley.event.EventMetadata;
3435
import org.commonjava.maven.galley.model.ConcreteResource;
@@ -139,10 +140,27 @@ public void updatePathPromoteMetrics( int total, PathsPromoteResult result )
139140
public List<Transfer> getTransfersForPaths( final StoreKey source, final Set<String> paths )
140141
throws IndyWorkflowException
141142
{
143+
144+
ArtifactStore store;
145+
try
146+
{
147+
store = storeManager.getArtifactStore( source );
148+
}
149+
catch ( final IndyDataException e )
150+
{
151+
throw new IndyWorkflowException( "Failed to retrieve ArtifactStore for: %s. Reason: %s", e, source,
152+
e.getMessage() );
153+
}
154+
155+
if ( store == null )
156+
{
157+
throw new IndyWorkflowException( ApplicationStatus.NOT_FOUND.code(), "Cannot find store: {}", source );
158+
}
159+
142160
final List<Transfer> contents = new ArrayList<>();
143161
for ( final String path : paths )
144162
{
145-
final Transfer transfer = downloadManager.getStorageReference( source, path );
163+
final Transfer transfer = downloadManager.getStorageReference( store, path );
146164
contents.add( transfer );
147165
}
148166
return contents;

0 commit comments

Comments
 (0)