/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-14 17:40:10 UTC
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190314174010-s0e2h0oq732ehilj
mandos-ctl: Refactor

* mandos-ctl (main): Rename "mandos_clients" to "all_clients".  When
                     no clients are given as options, use all_clients
                     directly instead of constructing a new dict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        dbus_logger.addFilter(dbus_filter)
119
119
        log.debug("D-Bus: %s:%s:%s.GetManagedObjects()", dbus_busname,
120
120
                  server_dbus_path, dbus.OBJECT_MANAGER_IFACE)
121
 
        mandos_clients = {path: ifs_and_props[client_dbus_interface]
122
 
                          for path, ifs_and_props in
123
 
                          mandos_serv_object_manager
124
 
                          .GetManagedObjects().items()
125
 
                          if client_dbus_interface in ifs_and_props}
 
121
        all_clients = {path: ifs_and_props[client_dbus_interface]
 
122
                       for path, ifs_and_props in
 
123
                       mandos_serv_object_manager
 
124
                       .GetManagedObjects().items()
 
125
                       if client_dbus_interface in ifs_and_props}
126
126
    except dbus.exceptions.DBusException as e:
127
127
        log.critical("Failed to access Mandos server through D-Bus:"
128
128
                     "\n%s", e)
135
135
    clients = {}
136
136
 
137
137
    if not clientnames:
138
 
        clients = {objpath: properties
139
 
                   for objpath, properties in mandos_clients.items()}
 
138
        clients = all_clients
140
139
    else:
141
140
        for name in clientnames:
142
 
            for objpath, properties in mandos_clients.items():
 
141
            for objpath, properties in all_clients.items():
143
142
                if properties["Name"] == name:
144
143
                    clients[objpath] = properties
145
144
                    break