summaryrefslogtreecommitdiffstats
path: root/dmaap/dmaapplugin
diff options
context:
space:
mode:
Diffstat (limited to 'dmaap/dmaapplugin')
-rw-r--r--dmaap/dmaapplugin/__init__.py3
-rw-r--r--dmaap/dmaapplugin/dr_bridge.py3
-rw-r--r--dmaap/dmaapplugin/dr_lifecycle.py15
-rw-r--r--dmaap/dmaapplugin/dr_relationships.py3
-rw-r--r--dmaap/dmaapplugin/mr_lifecycle.py3
5 files changed, 16 insertions, 11 deletions
diff --git a/dmaap/dmaapplugin/__init__.py b/dmaap/dmaapplugin/__init__.py
index 43da00e..faa331b 100644
--- a/dmaap/dmaapplugin/__init__.py
+++ b/dmaap/dmaapplugin/__init__.py
@@ -2,6 +2,7 @@
# org.onap.ccsdk
# =============================================================================
# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2020 Pantheon.tech. 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,7 +22,7 @@ from consulif.consulif import ConsulHandle
from cloudify.exceptions import NonRecoverableError
import os
-os.environ["REQUESTS_CA_BUNDLE"]="/opt/onap/certs/cacert.pem" # 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 = "consul" # Should always be a local consul agent on Cloudify Manager
DBCL_KEY_NAME = "dmaap-plugin" # Consul key containing DMaaP data bus credentials
diff --git a/dmaap/dmaapplugin/dr_bridge.py b/dmaap/dmaapplugin/dr_bridge.py
index 25022bb..f4c5cdc 100644
--- a/dmaap/dmaapplugin/dr_bridge.py
+++ b/dmaap/dmaapplugin/dr_bridge.py
@@ -2,6 +2,7 @@
# org.onap.ccsdk
# =============================================================================
# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2020 Pantheon.tech. 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.
@@ -20,7 +21,7 @@ from cloudify import ctx
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError
from dmaapplugin import DMAAP_API_URL, DMAAP_USER, DMAAP_PASS
-from dmaaputils import random_string
+from dmaapplugin.dmaaputils import random_string
from dmaapcontrollerif.dmaap_requests import DMaaPControllerHandle
# Set up a subscriber to a source feed
diff --git a/dmaap/dmaapplugin/dr_lifecycle.py b/dmaap/dmaapplugin/dr_lifecycle.py
index 718158a..4efeef5 100644
--- a/dmaap/dmaapplugin/dr_lifecycle.py
+++ b/dmaap/dmaapplugin/dr_lifecycle.py
@@ -2,6 +2,7 @@
# org.onap.ccsdk
# =============================================================================
# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2020 Pantheon.tech. 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.
@@ -20,7 +21,7 @@ from cloudify import ctx
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError
from dmaapplugin import DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, DMAAP_OWNER
-from dmaaputils import random_string
+from dmaapplugin.dmaaputils import random_string
from dmaapcontrollerif.dmaap_requests import DMaaPControllerHandle
# Lifecycle operations for DMaaP Data Router feeds
@@ -47,19 +48,19 @@ def create_feed(**kwargs):
feed_name = random_string(12)
# Set defaults/placeholders for the optional properties for the feed
- if "feed_version" in ctx.node.properties.keys():
+ if "feed_version" in ctx.node.properties:
feed_version = ctx.node.properties["feed_version"]
else:
feed_version = "0.0"
- if "feed_description" in ctx.node.properties.keys():
+ if "feed_description" in ctx.node.properties:
feed_description = ctx.node.properties["feed_description"]
else:
feed_description = "No description provided"
- if "aspr_classification" in ctx.node.properties.keys():
+ if "aspr_classification" in ctx.node.properties:
aspr_classification = ctx.node.properties["aspr_classification"]
else:
aspr_classification = "unclassified"
- if "useExisting" in ctx.node.properties.keys():
+ if "useExisting" in ctx.node.properties:
useExisting = ctx.node.properties["useExisting"]
else:
useExisting = False
@@ -98,10 +99,10 @@ def get_existing_feed(**kwargs):
dmc = DMaaPControllerHandle(DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, ctx.logger)
ctx.logger.info("DMaaPControllerHandle() returned")
feed_id_input = False
- if "feed_id" in ctx.node.properties.keys():
+ if "feed_id" in ctx.node.properties:
feed_id_input = True
f = dmc.get_feed_info(ctx.node.properties["feed_id"])
- elif "feed_name" in ctx.node.properties.keys():
+ elif "feed_name" in ctx.node.properties:
feed_name = ctx.node.properties["feed_name"]
f = dmc.get_feed_info_by_name(feed_name)
if f is None:
diff --git a/dmaap/dmaapplugin/dr_relationships.py b/dmaap/dmaapplugin/dr_relationships.py
index 4c955f2..bdb742d 100644
--- a/dmaap/dmaapplugin/dr_relationships.py
+++ b/dmaap/dmaapplugin/dr_relationships.py
@@ -2,6 +2,7 @@
# org.onap.ccsdk
# =============================================================================
# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2020 Pantheon.tech. 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.
@@ -20,7 +21,7 @@ from cloudify import ctx
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError
from dmaapplugin import DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, CONSUL_HOST
-from dmaaputils import random_string
+from dmaapplugin.dmaaputils import random_string
from dmaapcontrollerif.dmaap_requests import DMaaPControllerHandle
from consulif.consulif import ConsulHandle
diff --git a/dmaap/dmaapplugin/mr_lifecycle.py b/dmaap/dmaapplugin/mr_lifecycle.py
index ec674de..eb4e1ba 100644
--- a/dmaap/dmaapplugin/mr_lifecycle.py
+++ b/dmaap/dmaapplugin/mr_lifecycle.py
@@ -2,6 +2,7 @@
# org.onap.ccsdk
# =============================================================================
# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2020 Pantheon.tech. 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.
@@ -20,7 +21,7 @@ from cloudify import ctx
from cloudify.decorators import operation
from cloudify.exceptions import NonRecoverableError
from dmaapplugin import DMAAP_API_URL, DMAAP_USER, DMAAP_PASS, DMAAP_OWNER
-from dmaaputils import random_string
+from dmaapplugin.dmaaputils import random_string
from dmaapcontrollerif.dmaap_requests import DMaaPControllerHandle
# Lifecycle operations for DMaaP Message Router topics