Fix reference config before initialization in cli tests
In 'setUpClass' method config groups were referenced
before initialization using still empty oslo.config
which is empty if use without other cli test suites.
Fixed.
Change-Id: I4f0109617bf98bbb375cfcf816c074762b9fc69a
Closes-Bug: #1265909
diff --git a/tempest/cli/simple_read_only/test_ceilometer.py b/tempest/cli/simple_read_only/test_ceilometer.py
index 8bdd633..b762b47 100644
--- a/tempest/cli/simple_read_only/test_ceilometer.py
+++ b/tempest/cli/simple_read_only/test_ceilometer.py
@@ -15,17 +15,16 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-
-import tempest.cli
+from tempest import cli
+from tempest import config
from tempest.openstack.common import log as logging
-CONF = cfg.CONF
+CONF = config.CONF
LOG = logging.getLogger(__name__)
-class SimpleReadOnlyCeilometerClientTest(tempest.cli.ClientTestBase):
+class SimpleReadOnlyCeilometerClientTest(cli.ClientTestBase):
"""Basic, read-only tests for Ceilometer CLI client.
Checks return values and output of read-only commands.
diff --git a/tempest/cli/simple_read_only/test_neutron.py b/tempest/cli/simple_read_only/test_neutron.py
index 80376ab..d1e7d61 100644
--- a/tempest/cli/simple_read_only/test_neutron.py
+++ b/tempest/cli/simple_read_only/test_neutron.py
@@ -18,18 +18,17 @@
import re
import subprocess
-from oslo.config import cfg
-
-import tempest.cli
+from tempest import cli
+from tempest import config
from tempest.openstack.common import log as logging
from tempest import test
-CONF = cfg.CONF
+CONF = config.CONF
LOG = logging.getLogger(__name__)
-class SimpleReadOnlyNeutronClientTest(tempest.cli.ClientTestBase):
+class SimpleReadOnlyNeutronClientTest(cli.ClientTestBase):
"""Basic, read-only tests for Neutron CLI client.
Checks return values and output of read-only commands.
@@ -87,7 +86,7 @@
def _test_neutron_lbaas_command(self, command):
try:
self.neutron(command)
- except tempest.cli.CommandFailed as e:
+ except cli.CommandFailed as e:
if '404 Not Found' not in e.stderr:
self.fail('%s: Unexpected failure.' % command)
@@ -154,7 +153,7 @@
'router-show', 'agent-update', 'help'))
self.assertFalse(wanted_commands - commands)
- # Optional arguments:
+ # Optional arguments:
@test.attr(type='smoke')
def test_neutron_version(self):