mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
netcmd: silos: silo and auth policy commands use print
This adds more consistency with newer code added after these commands. But also print seems more flexible and requires no newline characters added constantly which ends up being a bit cleaner. Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
parent
983f04e1aa
commit
9238afc16c
@ -200,7 +200,7 @@ class cmd_domain_auth_policy_list(Command):
|
||||
self.print_json(policies)
|
||||
else:
|
||||
for policy in policies.keys():
|
||||
self.outf.write(f"{policy}\n")
|
||||
print(policy, file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_policy_view(Command):
|
||||
@ -413,7 +413,7 @@ class cmd_domain_auth_policy_create(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Authentication policy created successfully.
|
||||
self.outf.write(f"Created authentication policy: {name}\n")
|
||||
print(f"Created authentication policy: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_policy_modify(Command):
|
||||
@ -621,7 +621,7 @@ class cmd_domain_auth_policy_modify(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Authentication policy updated successfully.
|
||||
self.outf.write(f"Updated authentication policy: {name}\n")
|
||||
print(f"Updated authentication policy: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_policy_delete(Command):
|
||||
@ -670,7 +670,7 @@ class cmd_domain_auth_policy_delete(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Authentication policy deleted successfully.
|
||||
self.outf.write(f"Deleted authentication policy: {name}\n")
|
||||
print(f"Deleted authentication policy: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_policy(SuperCommand):
|
||||
|
@ -61,7 +61,7 @@ class cmd_domain_auth_silo_list(Command):
|
||||
self.print_json(silos)
|
||||
else:
|
||||
for silo in silos.keys():
|
||||
self.outf.write(f"{silo}\n")
|
||||
print(silo, file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_silo_view(Command):
|
||||
@ -212,7 +212,7 @@ class cmd_domain_auth_silo_create(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Authentication silo created successfully.
|
||||
self.outf.write(f"Created authentication silo: {name}\n")
|
||||
print(f"Created authentication silo: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_silo_modify(Command):
|
||||
@ -337,7 +337,7 @@ class cmd_domain_auth_silo_modify(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Silo updated successfully.
|
||||
self.outf.write(f"Updated authentication silo: {name}\n")
|
||||
print(f"Updated authentication silo: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_silo_delete(Command):
|
||||
@ -386,7 +386,7 @@ class cmd_domain_auth_silo_delete(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Authentication silo deleted successfully.
|
||||
self.outf.write(f"Deleted authentication silo: {name}\n")
|
||||
print(f"Deleted authentication silo: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_auth_silo(SuperCommand):
|
||||
|
@ -135,11 +135,10 @@ class cmd_domain_claim_claim_type_create(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Claim type created successfully.
|
||||
self.outf.write(f"Created claim type: {display_name}")
|
||||
message = f"Created claim type: {display_name}"
|
||||
if attribute_name != display_name:
|
||||
self.outf.write(f" ({attribute_name})\n")
|
||||
else:
|
||||
self.outf.write("\n")
|
||||
message += f" ({attribute_name})"
|
||||
print(message, file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_claim_claim_type_modify(Command):
|
||||
@ -226,7 +225,7 @@ class cmd_domain_claim_claim_type_modify(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Claim type updated successfully.
|
||||
self.outf.write(f"Updated claim type: {name}\n")
|
||||
print(f"Updated claim type: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_claim_claim_type_delete(Command):
|
||||
@ -275,7 +274,7 @@ class cmd_domain_claim_claim_type_delete(Command):
|
||||
raise CommandError(e)
|
||||
|
||||
# Claim type deleted successfully.
|
||||
self.outf.write(f"Deleted claim type: {name}\n")
|
||||
print(f"Deleted claim type: {name}", file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_claim_claim_type_list(Command):
|
||||
@ -311,7 +310,7 @@ class cmd_domain_claim_claim_type_list(Command):
|
||||
self.print_json(claim_types)
|
||||
else:
|
||||
for claim_type in claim_types.keys():
|
||||
self.outf.write(f"{claim_type}\n")
|
||||
print(claim_type, file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_claim_claim_type_view(Command):
|
||||
|
@ -59,7 +59,7 @@ class cmd_domain_claim_value_type_list(Command):
|
||||
self.print_json(value_types)
|
||||
else:
|
||||
for value_type in value_types.keys():
|
||||
self.outf.write(f"{value_type}\n")
|
||||
print(value_type, file=self.outf)
|
||||
|
||||
|
||||
class cmd_domain_claim_value_type_view(Command):
|
||||
|
Loading…
x
Reference in New Issue
Block a user