Change in vdsm[master]: stomp: introduction of header constants

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Mon May 18 14:43:50 UTC 2015


Piotr Kliczewski has uploaded a new change for review.

Change subject: stomp: introduction of header constants
......................................................................

stomp: introduction of header constants


Change-Id: Ibecb4f5ebaa962861ae5836a6594ad3a0f8c166c
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
---
M lib/yajsonrpc/stomp.py
M lib/yajsonrpc/stompReactor.py
2 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/41069/1

diff --git a/lib/yajsonrpc/stomp.py b/lib/yajsonrpc/stomp.py
index 25e11e2..ec38a4c 100644
--- a/lib/yajsonrpc/stomp.py
+++ b/lib/yajsonrpc/stomp.py
@@ -53,6 +53,16 @@
     RECEIPT = "RECEIPT"
 
 
+class Headers(object):
+    CONTENT_LENGTH = "content-length"
+    CONTENT_TYPE = "content-type"
+    SUBSCRIPTION = "subscription"
+    DESTINATION = "destination"
+    ACCEPT_VERSION = "accept-version"
+    REPLY_TO = "reply-to"
+    HEARTEBEAT = "heart-beat"
+
+
 COMMANDS = tuple([command for command in dir(Command)
                   if not command.startswith('_')])
 
diff --git a/lib/yajsonrpc/stompReactor.py b/lib/yajsonrpc/stompReactor.py
index 89f0e12..857a30b 100644
--- a/lib/yajsonrpc/stompReactor.py
+++ b/lib/yajsonrpc/stompReactor.py
@@ -66,7 +66,7 @@
         else:
             res = stomp.Frame(stomp.Command.CONNECTED, {"version": "1.2"})
             cx, cy = parseHeartBeatHeader(
-                frame.headers.get("heart-beat", "0,0")
+                frame.headers.get(stomp.Headers.HEARTEBEAT, "0,0")
             )
 
             # Make sure the heart-beat interval is sane


-- 
To view, visit https://gerrit.ovirt.org/41069
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibecb4f5ebaa962861ae5836a6594ad3a0f8c166c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>


More information about the vdsm-patches mailing list