diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/netcmd/domain/auth/silo_member.py | 20 | ||||
| -rw-r--r-- | python/samba/tests/samba_tool/domain_auth_silo.py | 3 |
2 files changed, 19 insertions, 4 deletions
diff --git a/python/samba/netcmd/domain/auth/silo_member.py b/python/samba/netcmd/domain/auth/silo_member.py index f9ec2686cf1..af5fbc0913b 100644 --- a/python/samba/netcmd/domain/auth/silo_member.py +++ b/python/samba/netcmd/domain/auth/silo_member.py @@ -75,7 +75,14 @@ class cmd_domain_auth_silo_member_add(Command): except ModelError as e: raise CommandError(e) - self.outf.write(f"User {user} added to the authentication silo {name}.\n") + # Display silo assigned status. + if user.assigned_silo and user.assigned_silo == silo.dn: + status = "assigned" + else: + status = "unassigned" + + print(f"User {user} added to the authentication silo {name} ({status}).", + file=self.outf) class cmd_domain_auth_silo_member_list(Command): @@ -122,7 +129,7 @@ class cmd_domain_auth_silo_member_list(Command): self.print_json([member.as_dict() for member in members]) else: for member in members: - self.outf.write(f"{member.dn}\n") + print(member.dn, file=self.outf) class cmd_domain_auth_silo_member_remove(Command): @@ -174,7 +181,14 @@ class cmd_domain_auth_silo_member_remove(Command): except ModelError as e: raise CommandError(e) - self.outf.write(f"User {user} removed from the authentication silo {name}.\n") + # Display silo assigned status. + if user.assigned_silo and user.assigned_silo == silo.dn: + status = "assigned" + else: + status = "unassigned" + + print(f"User {user} removed from the authentication silo {name} ({status}).", + file=self.outf) class cmd_domain_auth_silo_member(SuperCommand): diff --git a/python/samba/tests/samba_tool/domain_auth_silo.py b/python/samba/tests/samba_tool/domain_auth_silo.py index 69a3d441680..75f5e0b7e01 100644 --- a/python/samba/tests/samba_tool/domain_auth_silo.py +++ b/python/samba/tests/samba_tool/domain_auth_silo.py @@ -603,7 +603,8 @@ class AuthSiloMemberCmdTestCase(BaseAuthCmdTest): self.assertIsNone(result, msg=err) self.assertIn( - f"User {name} added to the authentication silo {silo}.", out) + f"User {name}$ added to the authentication silo {silo} (unassigned).", + out) def test_member_add__unknown_user(self): """Test adding an unknown user to an authentication silo.""" |
