veyron/tools/mgmt/nodex/acl_impl.go: additional review comments
Code improvements suggested post landing to the ACL setting portion of the
nodex command.
Change-Id: I04cbd807044ea20780d2e4c0f386d8dcb68876b9
diff --git a/tools/mgmt/nodex/acl_impl.go b/tools/mgmt/nodex/acl_impl.go
index 8348f5b..b4efc6a 100644
--- a/tools/mgmt/nodex/acl_impl.go
+++ b/tools/mgmt/nodex/acl_impl.go
@@ -16,7 +16,7 @@
Run: runGet,
Name: "get",
Short: "Get ACLs for the given target.",
- Long: "Get ACLs for the given target with friendly output. Also see getraw.",
+ Long: "Get ACLs for the given target.",
ArgsName: "<node manager name>",
ArgsLong: `
<node manager name> can be a Vanadium name for a node manager,
@@ -37,9 +37,8 @@
func (a byBlessing) Less(i, j int) bool { return a[i].blessing < a[j].blessing }
func runGet(cmd *cmdline.Command, args []string) error {
-
if expected, got := 1, len(args); expected != got {
- return cmd.UsageErrorf("install: incorrect number of arguments, expected %d, got %d", expected, got)
+ return cmd.UsageErrorf("get: incorrect number of arguments, expected %d, got %d", expected, got)
}
vanaName := args[0]
@@ -54,7 +53,6 @@
output = append(output, formattedACLEntry{string(k), "in", objACL.In[k].String()})
}
for k, _ := range objACL.NotIn {
-
output = append(output, formattedACLEntry{string(k), "nin", objACL.NotIn[k].String()})
}
@@ -74,7 +72,7 @@
Name: "acl",
Short: "Tool for creating associations between Vanadium blessings and a system account",
Long: `
-The associate tool facilitates managing blessing to system account associations.
+The acl tool manages ACLs on the node manger, installations and instances.
`,
Children: []*cmdline.Command{cmdGet},
}
diff --git a/tools/mgmt/nodex/acl_test.go b/tools/mgmt/nodex/acl_test.go
index fb629b9..ccd6d6b 100644
--- a/tools/mgmt/nodex/acl_test.go
+++ b/tools/mgmt/nodex/acl_test.go
@@ -46,7 +46,7 @@
t.Fatalf("%v, ouput: %v, error: %v", err)
}
if expected, got := "root/bob/... nin W\nroot/other in R\nroot/self/... in XRWADM", strings.TrimSpace(stdout.String()); got != expected {
- t.Fatalf("Unexpected output from list. Got %q, expected %q", got, expected)
+ t.Fatalf("Unexpected output from get. Got %q, expected %q", got, expected)
}
if got, expected := tape.Play(), []interface{}{"GetACL"}; !reflect.DeepEqual(expected, got) {
t.Errorf("invalid call sequence. Got %v, want %v", got, expected)