Signed-off-by: Isaku Yamahata <[email protected]>
---
 ryu/app/client.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ryu/app/client.py b/ryu/app/client.py
index eec9d0e..33e280a 100644
--- a/ryu/app/client.py
+++ b/ryu/app/client.py
@@ -17,6 +17,19 @@ import httplib
 import urlparse
 
 
+def ignore_http_not_found(func):
+    """
+    Ignore http not found(404) with Ryu client library.
+    Ryu client raises httplib.HTTPException with an error in args[0]
+    """
+    try:
+        func()
+    except httplib.HTTPException as e:
+        res = e.args[0]
+        if res.status != httplib.NOT_FOUND:
+            raise
+
+
 class RyuClientBase(object):
     def __init__(self, version, address):
         super(RyuClientBase, self).__init__()
-- 
1.7.1.1


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to