/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 at bsnet
  • Date: 2011-02-15 19:27:23 UTC
  • mto: (237.7.13 mandos)
  • mto: This revision was merged to the branch mainline in revision 282.
  • Revision ID: teddy@fukt.bsnet.se-20110215192723-qpftjhlvzadm5cjc
* mandos-ctl: Use unicode string literals.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
# Contact the authors at <mandos@fukt.bsnet.se>.
23
23
24
24
 
25
 
from __future__ import (division, absolute_import, print_function,
26
 
                        unicode_literals)
 
25
from __future__ import division, absolute_import, unicode_literals
27
26
 
28
27
import sys
29
28
import dbus
135
134
                                     clients))
136
135
                             for key in keywords)
137
136
    # Print header line
138
 
    print(format_string % tuple(tablewords[key] for key in keywords))
 
137
    print format_string % tuple(tablewords[key] for key in keywords)
139
138
    for client in clients:
140
 
        print(format_string % tuple(valuetostring(client[key], key)
141
 
                                    for key in keywords))
 
139
        print format_string % tuple(valuetostring(client[key], key)
 
140
                                    for key in keywords)
142
141
 
143
142
def has_actions(options):
144
143
    return any((options.enable,
217
216
            bus = dbus.SystemBus()
218
217
            mandos_dbus_objc = bus.get_object(busname, server_path)
219
218
        except dbus.exceptions.DBusException:
220
 
            print("Could not connect to Mandos server",
221
 
                  file=sys.stderr)
 
219
            print >> sys.stderr, "Could not connect to Mandos server"
222
220
            sys.exit(1)
223
221
    
224
222
        mandos_serv = dbus.Interface(mandos_dbus_objc,
237
235
                os.dup2(stderrcopy, sys.stderr.fileno())
238
236
                os.close(stderrcopy)
239
237
        except dbus.exceptions.DBusException, e:
240
 
            print("Access denied: Accessing mandos server through dbus.",
241
 
                  file=sys.stderr)
 
238
            print >> sys.stderr, "Access denied: Accessing mandos server through dbus."
242
239
            sys.exit(1)
243
240
            
244
241
        # Compile dict of (clients: properties) to process
256
253
                        clients[client_objc] = client
257
254
                        break
258
255
                else:
259
 
                    print("Client not found on server: %r" % name,
260
 
                          file=sys.stderr)
 
256
                    print >> sys.stderr, "Client not found on server: %r" % name
261
257
                    sys.exit(1)
262
258
            
263
259
        if not has_actions(options) and clients: