def set_credentials(self, username, password=None, region=None,
            tenant_id=None, authenticate=False):
        """Sets the username and password directly."""
        self.username = username
        self.password = password
        self.tenant_id = tenant_id
        if region:
            self.region = region
        if authenticate:
            self.authenticate()
def set_credentials ( self , username , password = None , region = None , tenant_id = None , authenticate = False ) : self . username = username self . password = password self . tenant_id = tenant_id if region : self . region = region if authenticate : self . authenticate ( )
Sets the username and password directly.