code: def _constructClient(client_version, username, user_domain, password, project_name, project_domain,
                           auth_url):
          
          loader = loading.get_plugin_loader('password')
  
          # These only work with v3
          if user_domain is not None or project_domain is not None:
              auth = loader.load_from_options(auth_url=auth_url, username=username, user_domain_name=user_domain,
                                              password=password, project_name=project_name, project_domain_name=project_domain)
          else:
              auth = loader.load_from_options(auth_url=auth_url, username=username,
                                              password=password, project_name=project_name)
  
          sess = session.Session(auth=auth)
          return client.Client(client_version, session=sess)
docs: Return a novaclient from the given args.