Skip to content

Commit

Permalink
Implement logic described by #7623 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenc-FNAL committed Sep 6, 2024
1 parent a714c20 commit da4dc28
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public class MigrationCopyCommand implements Callable<String> {
@Option(name = "target", values = {"pool", "pgroup", "link", "hsm"},
category = "Target options",
usage = "Determines the interpretation of the target names.")
String target = null;
String target = "pool";

@Option(name = "meta-only",
category = "Target options",
Expand Down Expand Up @@ -545,19 +545,17 @@ public class MigrationCopyCommand implements Callable<String> {

private RefreshablePoolList createPoolList(String type, List<String> targets) {
CellStub poolManager = _context.getPoolManagerStub();
if (type == null) {
type = "pgroup";
if (targets.isEmpty()) {
return new PoolListBySourcePoolPoolGroup(poolManager, _context.getPoolName());
}
}
switch (type) {
case "pool":
return new PoolListByNames(poolManager, targets);
case "hsm":
return new PoolListByHsm(poolManager, targets);
case "pgroup":
return new PoolListByPoolGroup(poolManager, targets);
if (targets.isEmpty()) {
return new PoolListBySourcePoolPoolGroup(poolManager, _context.getPoolName());
} else {
return new PoolListByPoolGroup(poolManager, targets);
}
case "link":
if (targets.size() != 1) {
throw new IllegalArgumentException(targets.toString() +
Expand Down

0 comments on commit da4dc28

Please sign in to comment.