]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netcmd: silo member: update docstrings comments and print statements for grant +...
authorRob van der Linde <rob@catalyst.net.nz>
Tue, 7 Nov 2023 20:26:15 +0000 (09:26 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Nov 2023 04:05:34 +0000 (04:05 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain/auth/silo_member.py
python/samba/tests/samba_tool/domain_auth_silo.py

index e7f3e0a3f3c662e075ecf192eb0ce8bc2f3b091c..9b414006e744ebdb5e90e1e6f83ffe3c188e2f36 100644 (file)
@@ -27,7 +27,7 @@ from samba.netcmd.domain.models.exceptions import ModelError
 
 
 class cmd_domain_auth_silo_member_grant(Command):
-    """Add a member access to an authentication silo."""
+    """Grant a member access to an authentication silo."""
 
     synopsis = "%prog -H <URL> [options]"
 
@@ -69,7 +69,7 @@ class cmd_domain_auth_silo_member_grant(Command):
         if user is None:
             raise CommandError(f"User {member} not found.")
 
-        # Add member.
+        # Grant access to member.
         try:
             silo.grant(ldb, user)
         except ModelError as e:
@@ -81,7 +81,7 @@ class cmd_domain_auth_silo_member_grant(Command):
         else:
             status = "unassigned"
 
-        print(f"User {user} added to the authentication silo {name} ({status}).",
+        print(f"User {user} granted access to the authentication silo {name} ({status}).",
               file=self.outf)
 
 
@@ -133,7 +133,7 @@ class cmd_domain_auth_silo_member_list(Command):
 
 
 class cmd_domain_auth_silo_member_revoke(Command):
-    """Remove a member from an authentication silo."""
+    """Revoke a member from an authentication silo."""
 
     synopsis = "%prog -H <URL> [options]"
 
@@ -175,7 +175,7 @@ class cmd_domain_auth_silo_member_revoke(Command):
         if user is None:
             raise CommandError(f"User {member} not found.")
 
-        # Remove member.
+        # Revoke member access.
         try:
             silo.revoke(ldb, user)
         except ModelError as e:
@@ -187,7 +187,7 @@ class cmd_domain_auth_silo_member_revoke(Command):
         else:
             status = "unassigned"
 
-        print(f"User {user} removed from the authentication silo {name} ({status}).",
+        print(f"User {user} revoked from the authentication silo {name} ({status}).",
               file=self.outf)
 
 
index c469d6637eef94b443e280cbec0960c2b3387bc6..ae6476e363c124e5ba81c2ca4a8da6920b913ab3 100644 (file)
@@ -528,7 +528,8 @@ class AuthSiloMemberCmdTestCase(SiloTest):
 
         self.assertIsNone(result, msg=err)
         self.assertIn(
-            f"User {member} added to the authentication silo {silo}", out)
+            f"User {member} granted access to the authentication silo {silo}",
+            out)
         self.addCleanup(self.remove_silo_member, silo, member)
 
     def remove_silo_member(self, silo, member):
@@ -603,7 +604,7 @@ class AuthSiloMemberCmdTestCase(SiloTest):
 
         self.assertIsNone(result, msg=err)
         self.assertIn(
-            f"User {name}$ added to the authentication silo {silo} (unassigned).",
+            f"User {name}$ granted access to the authentication silo {silo} (unassigned).",
             out)
 
     def test_member_add__unknown_user(self):