
from tempest_lib.cli import base  # noqa

from tempest import config_share as config
from tempest import test

CONF = config.CONF


class ClientTestBase(base.ClientTestBase, test.BaseTestCase):

    def manila(self, action, flags='', params='', fail_ok=False,
               endpoint_type='publicURL', merge_stderr=False):
        """Executes manila command for the given action."""
        flags += ' --endpoint-type %s' % endpoint_type
        return self.clients.cmd_with_auth(
            'manila', action, flags, params, fail_ok, merge_stderr)

    def _get_clients(self):
        clients = base.CLIClient(
            CONF.identity.admin_username,
            CONF.identity.admin_password,
            CONF.identity.admin_tenant_name,
            CONF.identity.uri,
            CONF.cli.cli_dir,
        )
        return clients


from tempest import cli


class ClientTestBase(cli.ClientTestBase):

    def manila(self, action, flags='', params='', fail_ok=False,
               endpoint_type='publicURL', merge_stderr=False):
        """Executes manila command for the given action."""
        flags += ' --endpoint-type %s' % endpoint_type
        return self.clients.cmd_with_auth(
            'manila', action, flags, params, fail_ok, merge_stderr)

Fix tempest compatibility for cli tests
Fix tempest compatibility for cli tests

Commit https://github.com/openstack/tempest/commit/2474f41f made changes to
tempest project that are inconsistent with our plugin.
Make our plugin use latest changes to keep compatibility.

Change-Id: I08d28b40fdd9ad54a0bcce30647d796943332116

  
- from tempest_lib.cli import base  # noqa
- 
- from tempest import config_share as config
- from tempest import test
+ from tempest import cli
- 
- CONF = config.CONF
  
  
- class ClientTestBase(base.ClientTestBase, test.BaseTestCase):
+ class ClientTestBase(cli.ClientTestBase):
  
      def manila(self, action, flags='', params='', fail_ok=False,
                 endpoint_type='publicURL', merge_stderr=False):
          """Executes manila command for the given action."""
          flags += ' --endpoint-type %s' % endpoint_type
          return self.clients.cmd_with_auth(
              'manila', action, flags, params, fail_ok, merge_stderr)
  
-     def _get_clients(self):
-         clients = base.CLIClient(
-             CONF.identity.admin_username,
-             CONF.identity.admin_password,
-             CONF.identity.admin_tenant_name,
-             CONF.identity.uri,
-             CONF.cli.cli_dir,
-         )
-         return clients
- 
Fix tempest compatibility for cli tests
## Code Before:

from tempest_lib.cli import base  # noqa

from tempest import config_share as config
from tempest import test

CONF = config.CONF


class ClientTestBase(base.ClientTestBase, test.BaseTestCase):

    def manila(self, action, flags='', params='', fail_ok=False,
               endpoint_type='publicURL', merge_stderr=False):
        """Executes manila command for the given action."""
        flags += ' --endpoint-type %s' % endpoint_type
        return self.clients.cmd_with_auth(
            'manila', action, flags, params, fail_ok, merge_stderr)

    def _get_clients(self):
        clients = base.CLIClient(
            CONF.identity.admin_username,
            CONF.identity.admin_password,
            CONF.identity.admin_tenant_name,
            CONF.identity.uri,
            CONF.cli.cli_dir,
        )
        return clients

## Instruction:
Fix tempest compatibility for cli tests
## Code After:

from tempest import cli


class ClientTestBase(cli.ClientTestBase):

    def manila(self, action, flags='', params='', fail_ok=False,
               endpoint_type='publicURL', merge_stderr=False):
        """Executes manila command for the given action."""
        flags += ' --endpoint-type %s' % endpoint_type
        return self.clients.cmd_with_auth(
            'manila', action, flags, params, fail_ok, merge_stderr)
