Do not use `len(SEQUENCE)` to determine if a sequence is empty
[demo.git] / vnfs / VES5.0 / evel / evel-test-collector / code / collector / collector.py
index 58bebc7..6565e43 100644 (file)
@@ -13,9 +13,9 @@ License
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
+
          http://www.apache.org/licenses/LICENSE-2.0
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -526,7 +526,7 @@ USAGE
             raise RuntimeError('Invalid Vendor Event Listener port ({0}) '
                                'specified'.format(vel_port))
 
-        if (len(vel_path) > 0 and vel_path[-1] != '/'):
+        if (vel_path and vel_path[-1] != '/'):
             logger.warning('Event Listener Path ({0}) should have terminating '
                            '"/"!  Adding one on to configured string.'.format(
                                                                      vel_path))
@@ -590,8 +590,7 @@ USAGE
                    format(vel_path,
                           api_version,
                           '/' + vel_topic_name
-                          if len(vel_topic_name) > 0
-                          else '')
+                          if vel_topic_name else '')
         throttle_url = '/{0}eventListener/v{1}/clientThrottlingState'.\
                        format(vel_path, api_version)
         batch_url = '/{0}eventListener/v{1}/eventBatch'.\