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>
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):