Exemplo n.º 1
0
 def _reauthenticate_keystone(self):
     if self.token:
         self.keystone = keystoneclient.Client(token=self.token,
                                               endpoint=self.endpoint)
     else:
         self.keystone = ksclient.Client(
             username=self.inputs.stack_user,
             password=self.inputs.stack_password,
             tenant_name=self.inputs.project_name,
             auth_url=self.auth_url)
Exemplo n.º 2
0
    def __init__(self, username=None, password=None, tenant=None,
                 auth_url=None, token=None, endpoint=None,
                 insecure=True, region_name=None,
                 logger=None):

        self.logger = logger or contrail_logging.getLogger(__name__)
        if token:
            self.keystone = keystoneclient.Client(
                token=token, endpoint=endpoint)
        else:
            self.keystone = keystone_client.Client(
                username=username, password=password, tenant_name=tenant, auth_url=auth_url,
                insecure=insecure, region_name=region_name or 'RegionOne')
Exemplo n.º 3
0
    def __init__(self,
                 username=None,
                 password=None,
                 tenant=None,
                 auth_url=None,
                 token=None,
                 endpoint=None,
                 insecure=True):

        if token:
            self.keystone = keystoneclient.Client(token=token,
                                                  endpoint=endpoint)
        else:
            self.keystone = keystone_client.Client(username=username,
                                                   password=password,
                                                   tenant_name=tenant,
                                                   auth_url=auth_url,
                                                   insecure=insecure)
Exemplo n.º 4
0
 def __init__(self,
              connections,
              username=None,
              password=None,
              tenant=None,
              role='admin',
              token=None,
              endpoint=None):
     self.inputs = connections.inputs
     self.connections = connections
     self.logger = self.inputs.logger
     if self.inputs.orchestrator == 'vcenter':
         # No concept of user in vcenter, However we satisfy the test infra
         # with dummy fixture objects
         return
     insecure = bool(os.getenv('OS_INSECURE', True))
     if not self.inputs.ha_setup:
         self.auth_url = os.getenv('OS_AUTH_URL') or \
             'http://%s:5000/v2.0' % (self.inputs.openstack_ip)
     else:
         self.auth_url = os.getenv('OS_AUTH_URL') or \
             'http://%s:5000/v2.0' % (self.inputs.auth_ip)
     self.already_present = False
     self.username = username
     self.password = password
     self.tenant = tenant
     self.role = role
     self.email = str(username) + "@example.com"
     self.token = token
     self.endpoint = endpoint
     self.verify_is_run = False
     if self.token:
         self.keystone = keystoneclient.Client(token=self.token,
                                               endpoint=self.endpoint)
     else:
         self.keystone = ksclient.Client(
             username=self.inputs.stack_user,
             password=self.inputs.stack_password,
             tenant_name=self.inputs.project_name,
             auth_url=self.auth_url,
             insecure=insecure)