Skip to content

Commit 60e691b

Browse files
committed
Fix behaviour of --print (closes #9)
1 parent 1edfbcc commit 60e691b

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

riemann_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""A Python Riemann client and command line tool"""
22

3-
__version__ = '4.1.1'
3+
__version__ = '4.1.2'
44
__author__ = 'Sam Clements <[email protected]>'

riemann_client/command.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,21 @@ def tls_transport_factory(args):
7373

7474
def send_function(args, client):
7575
"""Sends a single command to Riemann"""
76-
event = client.event(
77-
time=args.time,
78-
state=args.state,
79-
host=args.event_host,
80-
description=args.description,
81-
service=args.service,
82-
tags=map(str.strip, args.tags.split(',')),
83-
ttl=args.ttl,
84-
metric_f=args.metric)
76+
event = client.create_event({
77+
'time': args.time,
78+
'state': args.state,
79+
'host': args.event_host,
80+
'description': args.description,
81+
'service': args.service,
82+
'tags': map(str.strip, args.tags.split(',')),
83+
'ttl': args.ttl,
84+
'metric_f': args.metric})
8585

8686
if args.print_message:
8787
print(str(event).strip())
8888

89+
client.send_event(event)
90+
8991
send = subparsers.add_parser('send', help='Send an event to Riemann')
9092

9193
send.add_argument(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setuptools.setup(
66
name='riemann-client',
7-
version='4.1.1',
7+
version='4.1.2',
88

99
author="Sam Clements",
1010
author_email="[email protected]",

0 commit comments

Comments
 (0)