X-Git-Url: https://gerrit.onap.org/r/gitweb?p=multicloud%2Fframework.git;a=blobdiff_plain;f=multivimbroker%2Fmultivimbroker%2Fpub%2Futils%2Fsyscomm.py;h=0d0419a9de8cfb0421c5104674a5c9e6161a0c12;hp=07606bfd200a60ae11f01a1e705f5c555c657c8c;hb=67430600410e312c2db5a6a7709da8e45a5245fa;hpb=300a7e4839621acfb006cd8baadee0c4ed2c8bba diff --git a/multivimbroker/multivimbroker/pub/utils/syscomm.py b/multivimbroker/multivimbroker/pub/utils/syscomm.py index 07606bf..0d0419a 100644 --- a/multivimbroker/multivimbroker/pub/utils/syscomm.py +++ b/multivimbroker/multivimbroker/pub/utils/syscomm.py @@ -12,23 +12,27 @@ import inspect import re -import multivimbroker.pub.exceptions as exceptions +import multivimbroker.pub.exceptions as exceptions from multivimbroker.pub.msapi.extsys import get_vim_by_id + + def fun_name(): return inspect.stack()[1][3] +# Which headers are hop-by-hop headers by default +HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', + 'proxy-authorization', 'te', 'trailers', + 'transfer-encoding', 'upgrade'] -# Which headers are hop-by-hop headers by default -HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade'] def getHeadersKeys(response): hopbyhop = HOP_BY_HOP - hopbyhop.extend([x.strip() for x in response.get('connection', '').split(',')]) + hopbyhop.extend([x.strip() + for x in response.get('connection', '').split(',')]) return [header for header in response.keys() if header not in hopbyhop] - def findMultivimDriver(vim=None): if vim and vim["type"] == "openstack": @@ -42,12 +46,11 @@ def findMultivimDriver(vim=None): elif vim and vim["type"] == "vmware": multivimdriver = "multivim-vio" else: - raise exceptions.NotFound("Not support VIM type") - return multivimdriver - + raise exceptions.NotFound("Not support VIM type") + return multivimdriver -def getMultivimDriver(vimid,full_path=""): +def getMultivimDriver(vimid, full_path=""): multivim = "multivim" vim = get_vim_by_id(vimid)