diff --git a/modules/dcache/src/main/java/org/dcache/pool/migration/MigrationModule.java b/modules/dcache/src/main/java/org/dcache/pool/migration/MigrationModule.java index 08ec19c3657..327f7ba5118 100644 --- a/modules/dcache/src/main/java/org/dcache/pool/migration/MigrationModule.java +++ b/modules/dcache/src/main/java/org/dcache/pool/migration/MigrationModule.java @@ -487,7 +487,7 @@ public class MigrationCopyCommand implements Callable { @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", @@ -545,19 +545,17 @@ public class MigrationCopyCommand implements Callable { private RefreshablePoolList createPoolList(String type, List 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() +