Ejemplo n.º 1
0
def main():
    from openstackclient_base.client import HttpClient
    global http_client
    auth = sys.argv[2:]
    http_client = HttpClient(username=auth[0],
                             password=auth[1],
                             tenant_name=auth[2],
                             auth_uri=auth[3])
    cmd = sys.argv[1]
    if cmd == "keystone":
        test_keystone()
    elif cmd == "nova":
        test_nova()
    else:
        test_glance(sys.argv[6])
Ejemplo n.º 2
0
 def test_empty_url(self):
     import socket
     from openstackclient_base.client import HttpClient
     c = HttpClient()
     self.assertRaises(socket.gaierror, lambda: c.request('', '/users'))
 def __init__(self, **kwargs):
     try:
         self.http_client = kwargs["http_client"]
     except KeyError:
         self.http_client = HttpClient(**kwargs)
Ejemplo n.º 4
0
 def test_empty_url(self):
     import socket
     from openstackclient_base.client import HttpClient
     c = HttpClient()
     self.assertRaises(socket.gaierror, lambda: c.request('', '/users'))
Ejemplo n.º 5
0
def test_unbound_token(auth):
    from openstackclient_base.client import HttpClient
    from openstackclient_base.keystone.client import IdentityPublicClient
    unbound = HttpClient(username=auth[0], password=auth[1], auth_uri=auth[3])
    print IdentityPublicClient(unbound).tenants.list()
Ejemplo n.º 6
0
Archivo: utils.py Proyecto: altai/focus
# <http://www.gnu.org/licenses/>.

import base64
import hashlib
import socket
import sys

import flask

import focus
from focus import clients

from openstackclient_base.client import HttpClient
from openstackclient_base.exceptions import NotFound

neo4j_client = HttpClient()
notifications_client = HttpClient()


def select_keys(d, keys, strict_order=True):
    if strict_order:
        for k in keys:
            yield d[k]
    else:
        for k, v in d.items():
            if k in keys:
                yield v


def create_hashed_password(password):
    """