Define message-summary dict keys as constants
Refactor code to eliminate hardcoded strings like "message state".
Add wrapper method and test for method rmr_set_vlevel.
Unpin xappframepy version in Ping/Pong Dockerfiles.
Use constants for message-state values instead of integers.
Drop all mentions of NNG.
Bump version to 1.1.0.
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: I27c0bcb4ae6d6a85b518510fd1a4c651d3445313
diff --git a/ricxappframe/xapp_frame.py b/ricxappframe/xapp_frame.py
index 58596b8..b81804e 100644
--- a/ricxappframe/xapp_frame.py
+++ b/ricxappframe/xapp_frame.py
@@ -1,7 +1,3 @@
-"""
-Framework for python xapps
-Framework here means Xapp classes that can be subclassed
-"""
# ==================================================================================
# Copyright (c) 2020 Nokia
# Copyright (c) 2020 AT&T Intellectual Property.
@@ -18,10 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================
+"""
+Framework for python xapps
+Framework here means Xapp classes that can be subclassed
+"""
+
from threading import Thread
from ricxappframe import xapp_rmr
-from ricxappframe.xapp_sdl import SDLWrapper
from ricxappframe.rmr import rmr
+from ricxappframe.xapp_sdl import SDLWrapper
from mdclogpy import Logger
# constants
@@ -337,7 +338,7 @@
if not self._rmr_loop.rcv_queue.empty():
(summary, sbuf) = self._rmr_loop.rcv_queue.get()
# dispatch
- func = self._dispatch.get(summary["message type"], None)
+ func = self._dispatch.get(summary[rmr.RMR_MS_MSG_TYPE], None)
if not func:
func = self._default_handler
func(self, summary, sbuf)