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/dmaapcontrollerif/dmaap_requests.py | |
parent | 87d14cfc2cdcdfecbc75396d5347eae295bfb570 (diff) | |
parent | 9b7e81e78c70514aa123482610e274869b6ba137 (diff) |
Merge "Support python3 in all plugins"
Diffstat (limited to 'dmaap/dmaapcontrollerif/dmaap_requests.py')
-rw-r--r-- | dmaap/dmaapcontrollerif/dmaap_requests.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/dmaap/dmaapcontrollerif/dmaap_requests.py b/dmaap/dmaapcontrollerif/dmaap_requests.py index 231953a..0f02594 100644 --- a/dmaap/dmaapcontrollerif/dmaap_requests.py +++ b/dmaap/dmaapcontrollerif/dmaap_requests.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. @@ -287,14 +288,15 @@ class DMaaPControllerHandle(object): locations.raise_for_status() # pull out location names for VALID locations with matching dcae_layer - return map(lambda l: l["dcaeLocationName"], - filter(lambda i : (i['dcaeLayer'] == dcae_layer and i['status'] == 'VALID'), - locations.json())) + return [location["dcaeLocationName"] for location in locations.json() + if location['dcaeLayer'] == dcae_layer + and location['status'] == 'VALID'] def get_dcae_central_locations(self): ''' Get the list of location names known to the DMaaP bus controller - whose "dcaeLayer" property contains "central" (ignoring case) and whose status is "VALID". + whose "dcaeLayer" property contains "central" (ignoring case) + and whose status is "VALID". "dcaeLayer" contains "central" for central sites. ''' # Do these as a separate step so things like 404 get reported precisely @@ -302,7 +304,7 @@ class DMaaPControllerHandle(object): locations.raise_for_status() # pull out location names for VALID central locations - return map(lambda l: l["dcaeLocationName"], - filter(lambda i : ('central' in i['dcaeLayer'].lower() and i['status'] == 'VALID'), - locations.json())) + return [location["dcaeLocationName"] for location in locations.json() + if 'central' in location['dcaeLayer'].lower() + and location['status'] == 'VALID'] |