
from rally.benchmark.scenarios import base
from rally import osclients


class Authenticate(base.Scenario):
    """This class should contain authentication mechanism for different
    types of clients like Keystone.
    """
    def keystone(self, **kwargs):
        keystone_endpoint = self.clients("endpoint")
        cl = osclients.Clients(keystone_endpoint)
        cl.get_keystone_client()


from rally.benchmark.scenarios import base


class Authenticate(base.Scenario):
    """This class should contain authentication mechanism for different
    types of clients like Keystone.
    """
    def keystone(self, **kwargs):
        self.clients("keystone")

Fix for Authentication scenario to correctly use self.clients
Fix for Authentication scenario to correctly use self.clients

Scenario has recently been refactored, self.clients in Scenario
now takes the name of the CLI client. During the refactoring,
the Authenticate scenario was not correctly updated, which
causes the authentication scenario to fail. This patch fixes
that.

Change-Id: I546c0846e00a5285f0d47bc80b6304a53cc566ff
Closes-Bug: #1291386

  
  from rally.benchmark.scenarios import base
- from rally import osclients
  
  
  class Authenticate(base.Scenario):
      """This class should contain authentication mechanism for different
      types of clients like Keystone.
      """
      def keystone(self, **kwargs):
+         self.clients("keystone")
-         keystone_endpoint = self.clients("endpoint")
-         cl = osclients.Clients(keystone_endpoint)
-         cl.get_keystone_client()
  
Fix for Authentication scenario to correctly use self.clients
## Code Before:

from rally.benchmark.scenarios import base
from rally import osclients


class Authenticate(base.Scenario):
    """This class should contain authentication mechanism for different
    types of clients like Keystone.
    """
    def keystone(self, **kwargs):
        keystone_endpoint = self.clients("endpoint")
        cl = osclients.Clients(keystone_endpoint)
        cl.get_keystone_client()

## Instruction:
Fix for Authentication scenario to correctly use self.clients
## Code After:

from rally.benchmark.scenarios import base


class Authenticate(base.Scenario):
    """This class should contain authentication mechanism for different
    types of clients like Keystone.
    """
    def keystone(self, **kwargs):
        self.clients("keystone")
