From 9cdef01070d0227b7a03e907d55de4a3b7295ce2 Mon Sep 17 00:00:00 2001 From: xufeiliu Date: Tue, 5 Mar 2019 04:40:50 +0000 Subject: [20190304] update copyright and __init__.py Update all copyrights. Update dmaapplugin/__init__.py to match the ONAP environment. 1) Consul address is "consul". 2) certificate is at /opt/onap/certs/cacert.pem. 3) Consul key name "dmaap-plugin" 4) Bus controller address is "dmaap-bc", port 8080 or 8443. Issue-ID: CCSDK-794 Change-Id: I47c85be11430510e2035f7972f97e63fe11757dc Signed-off-by: xufeiliu --- dmaap/LICENSE.txt | 2 +- dmaap/consulif/consulif.py | 2 +- dmaap/dmaap.yaml | 4 ++-- dmaap/dmaapcontrollerif/dmaap_requests.py | 2 +- dmaap/dmaapplugin/__init__.py | 21 +++++++++++---------- dmaap/dmaapplugin/dmaaputils.py | 2 +- dmaap/dmaapplugin/dr_bridge.py | 2 +- dmaap/dmaapplugin/dr_lifecycle.py | 2 +- dmaap/dmaapplugin/dr_relationships.py | 2 +- dmaap/dmaapplugin/mr_lifecycle.py | 2 +- dmaap/dmaapplugin/mr_relationships.py | 2 +- dmaap/pom.xml | 2 +- dmaap/setup.py | 2 +- dmaap/tests/test_plugin.py | 2 +- dmaap/tox.ini | 2 +- 15 files changed, 26 insertions(+), 25 deletions(-) diff --git a/dmaap/LICENSE.txt b/dmaap/LICENSE.txt index f90f8f1..b888c34 100644 --- a/dmaap/LICENSE.txt +++ b/dmaap/LICENSE.txt @@ -1,7 +1,7 @@ ============LICENSE_START======================================================= org.onap.ccsdk ================================================================================ -Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dmaap/consulif/consulif.py b/dmaap/consulif/consulif.py index e742895..8033603 100644 --- a/dmaap/consulif/consulif.py +++ b/dmaap/consulif/consulif.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaap.yaml b/dmaap/dmaap.yaml index ed8d5c3..8981568 100644 --- a/dmaap/dmaap.yaml +++ b/dmaap/dmaap.yaml @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ plugins: dmaapplugin: executor: 'central_deployment_agent' package_name: cloudifydmaapplugin - package_version: 1.3.1 + package_version: 1.3.2 node_types: diff --git a/dmaap/dmaapcontrollerif/dmaap_requests.py b/dmaap/dmaapcontrollerif/dmaap_requests.py index 0c52a77..5506865 100644 --- a/dmaap/dmaapcontrollerif/dmaap_requests.py +++ b/dmaap/dmaapcontrollerif/dmaap_requests.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaapplugin/__init__.py b/dmaap/dmaapplugin/__init__.py index ac988a4..43da00e 100644 --- a/dmaap/dmaapplugin/__init__.py +++ b/dmaap/dmaapplugin/__init__.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,11 +21,14 @@ from consulif.consulif import ConsulHandle from cloudify.exceptions import NonRecoverableError import os -os.environ["REQUESTS_CA_BUNDLE"]="/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt" # This is to handle https request thru plugin +os.environ["REQUESTS_CA_BUNDLE"]="/opt/onap/certs/cacert.pem" # This is to handle https request thru plugin -CONSUL_HOST = "127.0.0.1" # Should always be a local consul agent on Cloudify Manager -DBCL_KEY_NAME = "dmaap_dbcl_info" # Consul key containing DMaaP data bus credentials -DBC_SERVICE_NAME= "dmaap_bus_controller" # Name under which the DMaaP bus controller is registered +CONSUL_HOST = "consul" # Should always be a local consul agent on Cloudify Manager +DBCL_KEY_NAME = "dmaap-plugin" # Consul key containing DMaaP data bus credentials +# In the ONAP Kubernetes environment, bus controller address is always "dmaap-bc", on port 8080 (http) and 8443 (https) +ONAP_SERVICE_ADDRESS = "dmaap-bc" +HTTP_PORT = "8080" +HTTPS_PORT = "8443" try: _ch = ConsulHandle("http://{0}:8500".format(CONSUL_HOST), None, None, None) @@ -55,8 +58,10 @@ except Exception as e: try: if 'protocol' in config['dmaap']: DMAAP_PROTOCOL = config['dmaap']['protocol'] + service_port = HTTP_PORT else: DMAAP_PROTOCOL = 'https' # Default to https (service discovery should give us this but doesn't + service_port = HTTPS_PORT except Exception as e: raise NonRecoverableError("Error setting DMAAP_PROTOCOL while configuring dmaap plugin: {0}".format(e)) @@ -69,11 +74,7 @@ except Exception as e: raise NonRecoverableError("Error setting DMAAP_PATH while configuring dmaap plugin: {0}".format(e)) try: - service_address, service_port = _ch.get_service(DBC_SERVICE_NAME) -except Exception as e: - raise NonRecoverableError("Error getting service_address and service_port for '{0}' from ConsulHandle when configuring dmaap plugin: {1}".format(DBC_SERVICE_NAME, e)) - -try: + service_address = ONAP_SERVICE_ADDRESS DMAAP_API_URL = '{0}://{1}:{2}/{3}'.format(DMAAP_PROTOCOL, service_address, service_port, DMAAP_PATH) except Exception as e: raise NonRecoverableError("Error setting DMAAP_API_URL while configuring dmaap plugin: {0}".format(e)) diff --git a/dmaap/dmaapplugin/dmaaputils.py b/dmaap/dmaapplugin/dmaaputils.py index 9e80416..fd05a96 100644 --- a/dmaap/dmaapplugin/dmaaputils.py +++ b/dmaap/dmaapplugin/dmaaputils.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaapplugin/dr_bridge.py b/dmaap/dmaapplugin/dr_bridge.py index bf8f431..25022bb 100644 --- a/dmaap/dmaapplugin/dr_bridge.py +++ b/dmaap/dmaapplugin/dr_bridge.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaapplugin/dr_lifecycle.py b/dmaap/dmaapplugin/dr_lifecycle.py index 7473838..29811fa 100644 --- a/dmaap/dmaapplugin/dr_lifecycle.py +++ b/dmaap/dmaapplugin/dr_lifecycle.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaapplugin/dr_relationships.py b/dmaap/dmaapplugin/dr_relationships.py index 2443f26..dd67394 100644 --- a/dmaap/dmaapplugin/dr_relationships.py +++ b/dmaap/dmaapplugin/dr_relationships.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaapplugin/mr_lifecycle.py b/dmaap/dmaapplugin/mr_lifecycle.py index 2328ec3..a4f04ec 100644 --- a/dmaap/dmaapplugin/mr_lifecycle.py +++ b/dmaap/dmaapplugin/mr_lifecycle.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/dmaapplugin/mr_relationships.py b/dmaap/dmaapplugin/mr_relationships.py index ff92d67..7036277 100644 --- a/dmaap/dmaapplugin/mr_relationships.py +++ b/dmaap/dmaapplugin/mr_relationships.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/pom.xml b/dmaap/pom.xml index f3d0f7c..8c6ff0e 100755 --- a/dmaap/pom.xml +++ b/dmaap/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= org.onap.ccsdk ================================================================================ -Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/dmaap/setup.py b/dmaap/setup.py index e4749c1..987a824 100644 --- a/dmaap/setup.py +++ b/dmaap/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name = "cloudifydmaapplugin", - version = "1.3.1", + version = "1.3.2", packages=find_packages(), author = "AT&T", description = ("Cloudify plugin for creating DMaaP feeds and topics, and setting up publishers and subscribers."), diff --git a/dmaap/tests/test_plugin.py b/dmaap/tests/test_plugin.py index b9ebedc..8995315 100644 --- a/dmaap/tests/test_plugin.py +++ b/dmaap/tests/test_plugin.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/dmaap/tox.ini b/dmaap/tox.ini index 9a23f83..15a07f2 100644 --- a/dmaap/tox.ini +++ b/dmaap/tox.ini @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.ccsdk # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -- cgit 1.2.3-korg