summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorhongyuzhao <zhao.hongyu@zte.com.cn>2019-05-24 13:45:42 +0800
committerhongyuzhao <zhao.hongyu@zte.com.cn>2019-05-24 14:13:42 +0800
commit4cd87bf3928d2f89c4f09da8c2f2a8ab503e5f7c (patch)
treedc177a416c34683406fb099044307887d18171e3 /lcm
parent3e5e393882d6c7b2cf1252d6b2ae4944efb7fe85 (diff)
Fix bug for status code 303 location HEAD field is NULL
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn> Change-Id: If8b109194a61294e5d22cf285beb7edf36f158d9 Issue-ID: VFC-1358
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/biz/create_subscription.py5
-rw-r--r--lcm/lcm/nf/views/common.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/lcm/lcm/nf/biz/create_subscription.py b/lcm/lcm/nf/biz/create_subscription.py
index 6802c221..8c6d4528 100644
--- a/lcm/lcm/nf/biz/create_subscription.py
+++ b/lcm/lcm/nf/biz/create_subscription.py
@@ -27,6 +27,7 @@ from lcm.pub.database.models import SubscriptionModel
from lcm.pub.exceptions import NFLCMException
from lcm.pub.exceptions import NFLCMExceptionSeeOther
from lcm.pub.utils.values import ignore_case_get
+from lcm.pub.config.config import MSB_SERVICE_IP, MSB_SERVICE_PORT
logger = logging.getLogger(__name__)
@@ -117,8 +118,8 @@ class CreateSubscription:
return True
for subscription in subscriptions:
if self.check_filter_exists(subscription):
- raise NFLCMExceptionSeeOther("Already Subscription exists with the "
- "same callbackUri and filter")
+ links = json.loads(subscription.links)
+ raise NFLCMExceptionSeeOther("http://%s:%s/%s" % (MSB_SERVICE_IP, MSB_SERVICE_PORT, links["self"]["href"]))
return False
def save_db(self):
diff --git a/lcm/lcm/nf/views/common.py b/lcm/lcm/nf/views/common.py
index 4f864263..a57a93e1 100644
--- a/lcm/lcm/nf/views/common.py
+++ b/lcm/lcm/nf/views/common.py
@@ -53,7 +53,7 @@ def view_safe_call_with_log(logger):
except NFLCMExceptionSeeOther as e:
logger.error(e.message)
resp = Response(status=status.HTTP_303_SEE_OTHER)
- resp["Location"] = ""
+ resp["Location"] = e.message
# resp["Location"] = "subscriptions/%s" % e.id
return resp
except NFLCMExceptionNotFound as e: