/mandos/trunk

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

« back to all changes in this revision

Viewing changes to mandos-ctl

  • Committer: Teddy Hogeborn
  • Date: 2012-05-25 15:59:39 UTC
  • Revision ID: teddy@recompile.se-20120525155939-bg6ricuff86zsjgx
* network-hooks.d/wireless: Read from config file, so don't run "env".

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#     GNU General Public License for more details.
18
18
19
19
# You should have received a copy of the GNU General Public License
20
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
# along with this program.  If not, see
 
21
# <http://www.gnu.org/licenses/>.
21
22
22
23
# Contact the authors at <mandos@recompile.se>.
23
24
25
26
from __future__ import (division, absolute_import, print_function,
26
27
                        unicode_literals)
27
28
 
 
29
from future_builtins import *
 
30
 
28
31
import sys
29
32
import dbus
30
33
import argparse
60
63
server_path = "/"
61
64
server_interface = domain + ".Mandos"
62
65
client_interface = domain + ".Mandos.Client"
63
 
version = "1.5.3"
 
66
version = "1.5.4"
64
67
 
65
68
def timedelta_to_milliseconds(td):
66
69
    """Convert a datetime.timedelta object to milliseconds"""
116
119
        if type(value) is dbus.Boolean:
117
120
            return "Yes" if value else "No"
118
121
        if keyword in ("Timeout", "Interval", "ApprovalDelay",
119
 
                       "ApprovalDuration"):
 
122
                       "ApprovalDuration", "ExtendedTimeout"):
120
123
            return milliseconds_to_string(value)
121
124
        return unicode(value)
122
125
    
207
210
    parser.add_argument("client", nargs="*", help="Client name")
208
211
    options = parser.parse_args()
209
212
    
210
 
    if has_actions(options) and not options.client and not options.all:
 
213
    if has_actions(options) and not (options.client or options.all):
211
214
        parser.error("Options require clients names or --all.")
212
215
    if options.verbose and has_actions(options):
213
216
        parser.error("--verbose can only be used alone or with"