diff options
author | Dan Timoney <dtimoney@att.com> | 2020-02-20 21:14:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-20 21:14:26 +0000 |
commit | 6a407a45c77662a42160462c8fa69261f3fc76b3 (patch) | |
tree | 8978922b2a24285eacd21e4afcc4cea5f3bc42f3 /dmaap/dmaapplugin/dr_lifecycle.py | |
parent | 87d14cfc2cdcdfecbc75396d5347eae295bfb570 (diff) | |
parent | 9b7e81e78c70514aa123482610e274869b6ba137 (diff) |
Merge "Support python3 in all plugins"
Diffstat (limited to 'dmaap/dmaapplugin/dr_lifecycle.py')
-rw-r--r-- | dmaap/dmaapplugin/dr_lifecycle.py | 15 |
1 files changed, 8 insertions, 7 deletions
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: |