/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to mandos-ctl

  • Committer: Teddy Hogeborn
  • Date: 2019-03-12 20:29:54 UTC
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190312202954-2us36c6j9u5avhm7
mandos-ctl: Refactor

* mandos-ctl (PrintCmd): Rename to "OutputCmd".  All users changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
568
568
        self.mandos.RemoveClient(client.__dbus_object_path__)
569
569
 
570
570
 
571
 
class PrintCmd(Command):
572
 
    """Abstract class for commands printing client details"""
 
571
class OutputCmd(Command):
 
572
    """Abstract class for commands outputting client details"""
573
573
    all_keywords = ("Name", "Enabled", "Timeout", "LastCheckedOK",
574
574
                    "Created", "Interval", "Host", "KeyID",
575
575
                    "Fingerprint", "CheckerRunning", "LastEnabled",
583
583
        raise NotImplementedError()
584
584
 
585
585
 
586
 
class DumpJSONCmd(PrintCmd):
 
586
class DumpJSONCmd(OutputCmd):
587
587
    def output(self, clients):
588
588
        data = {client["Name"]:
589
589
                {key: self.dbus_boolean_to_bool(client[key])
597
597
        return value
598
598
 
599
599
 
600
 
class PrintTableCmd(PrintCmd):
 
600
class PrintTableCmd(OutputCmd):
601
601
    def __init__(self, verbose=False):
602
602
        self.verbose = verbose
603
603