Skip to content

Commit 3214bc2

Browse files
committed
nfs: add a possibility to list exports per host
Acked-by: paul Millar Target: trunk, 2.6 Require-book: no Require-notes: yes
1 parent fabb5ef commit 3214bc2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

modules/dcache/src/main/java/org/dcache/chimera/nfsv41/door/NFSv41Door.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
package org.dcache.chimera.nfsv41.door;
55

6+
import com.google.common.base.Joiner;
67
import org.glassfish.grizzly.Buffer;
78
import org.slf4j.Logger;
89
import org.slf4j.LoggerFactory;
@@ -487,14 +488,14 @@ public String ac_exports_reload(Args args) throws IOException {
487488
_exportFile.rescan();
488489
return "Done";
489490
}
490-
public static final String fh_exports_ls = " # dump nfs exports";
491-
public String ac_exports_ls(Args args) {
492-
StringBuilder sb = new StringBuilder();
493-
for(FsExport export: _exportFile.getExports()) {
494-
sb.append(export).append("\n");
491+
public static final String fh_exports_ls = " [host] # dump nfs exports";
492+
public String ac_exports_ls_$_0_1(Args args) throws UnknownHostException {
493+
InetAddress address = InetAddress.getByName(args.argv(0));
494+
if (args.argc() > 0 ) {
495+
return Joiner.on('\n').join(_exportFile.exportsFor(address));
496+
} else {
497+
return Joiner.on('\n').join(_exportFile.getExports());
495498
}
496-
497-
return sb.toString();
498499
}
499500

500501
private static deviceid4 deviceidOf(int id) {

0 commit comments

Comments
 (0)