diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-01-28 11:30:47 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-01-28 11:54:16 +0100 |
commit | 52da4424869eecd428c29a41f1699e6e00767055 (patch) | |
tree | 081a4ea6045ea8b8960c64f611bcc69bb6f17bf8 /functest/opnfv_tests/openstack/snaps/snaps_utils.py | |
parent | c6092cb676363d89f366dc9a416ba6c53eeea33f (diff) |
Fix warnings in all snaps-related modules
It also adds vping/__init__.py to stop skipping vping unit tests.
It removes the useless import os which is not required for mock (here
the mock patch was simply false).
It should be noted that the code is partially duplicated between
snaps_test_runner.py and vping_base_base.py. A small part of code has
been rewritten to fix that without multi inheritance.
Change-Id: I2e3e181ad7dab8aa41afb1e63d0b6795ff0d1610
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/snaps/snaps_utils.py')
-rw-r--r-- | functest/opnfv_tests/openstack/snaps/snaps_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/functest/opnfv_tests/openstack/snaps/snaps_utils.py b/functest/opnfv_tests/openstack/snaps/snaps_utils.py index 284e88b5..1153b63d 100644 --- a/functest/opnfv_tests/openstack/snaps/snaps_utils.py +++ b/functest/opnfv_tests/openstack/snaps/snaps_utils.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # Copyright (c) 2015 All rights reserved # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -5,6 +7,8 @@ # # http://www.apache.org/licenses/LICENSE-2.0 +# pylint: disable=missing-docstring + from functest.utils.constants import CONST from snaps.openstack.utils import neutron_utils, nova_utils @@ -19,7 +23,7 @@ def get_ext_net_name(os_creds): """ neutron = neutron_utils.neutron_client(os_creds) ext_nets = neutron_utils.get_external_networks(neutron) - if (hasattr(CONST, 'EXTERNAL_NETWORK')): + if hasattr(CONST, 'EXTERNAL_NETWORK'): extnet_config = CONST.__getattribute__('EXTERNAL_NETWORK') for ext_net in ext_nets: if ext_net.name == extnet_config: |