The Python SDK for the Rackspace Cloud

Overview

pyrax

https://travis-ci.com/pycontribs/pyrax.svg?branch=master

Python SDK for OpenStack/Rackspace APIs

DEPRECATED: Pyrax is no longer being developed or supported. See openstacksdk and the rackspacesdk plugin in order to interact with Rackspace's OpenStack-based public cloud.

See the LICENSE file for license and copyright information.

pyrax should work with most OpenStack-based cloud deployments, though it specifically targets the Rackspace public cloud. For example, the code for cloudfiles contains the ability to publish your content on Rackspace's CDN network, even though CDN support is not part of OpenStack Swift. But if you don't use any of the CDN-related code, your app will work fine on any standard Swift deployment.

See the Release Notes for what has changed in the latest release

Getting Started with OpenStack/Rackspace

To sign up for a Rackspace Cloud account, go to

http://cart.rackspace.com/cloud

and follow the prompts.

If you are working with an OpenStack deployment, you can find more information at http://www.openstack.org.

Requirements

  • A Rackspace Cloud account
    • username
    • API key
  • Python 2.7, 3.4, 3.5, 3.6, or 3.7
    • Support for Python 3.4 ends in March 2019.
    • Support for Python 2.7 ends at the end of 2019.
    • pyrax is not yet tested yet with other Python versions. Please post feedback about what works or does not work with other versions. See the Support and Feedback section below for where to post.

Installation

The best way to install pyrax is by using pip to get the latest official release:

pip install pyrax

If you would like to work with the current development state of pyrax, you can install directly from trunk on GitHub:

pip install git+git://github.com/pycontribs/pyrax.git

If you are not using virtualenv, you will need to run pip install --user to install into your user account's site packages.

You may also download and install from source. The source code for pyrax is available on GitHub.

Once you have the source code, cd to the base directory of the source and run (using sudo, if necessary):

python setup.py install

For more information on getting started, check out the following documentation:

https://github.com/pycontribs/pyrax/blob/master/docs/getting_started.md https://developer.rackspace.com/sdks/python/

Updates

If you installed pyrax using pip, it is simple to get the latest updates from either PyPI or GitHub:

# PyPI
pip install --upgrade pyrax
# GitHub
pip install --upgrade git+git://github.com/pycontribs/pyrax.git

Contributing

Please see the HACKING file for contribution guidelines. Make sure pull requests are on the master branch!

Support and Feedback

You can find documentation for using the pyrax SDK at https://developer.rackspace.com/sdks/python/.

Your feedback is appreciated! If you have specific issues with the pyrax SDK, developers should file an issue via Github.

For general feedback and support requests, contact us at https://developer.rackspace.com/support/

Comments
  • Problem with setting custom header 'Access-Control-Allow-Origin' for cloudfile in Rackspace

    Problem with setting custom header 'Access-Control-Allow-Origin' for cloudfile in Rackspace

    Unable to configure 'Access-Control-Allow-Origin' header for file in RackspaceFiles Steps to reproduce: YYY - username XXX - apikey ZZZ - Rackspace service center (ORD/DFW/etc) CCC - Cloud Files Container Name (test_cont) FFF - Uploaded file name (t1.JPG)

    [[email protected] ~]# python -c 'import pyrax;pyrax.settings.set("identity_type", "rackspace");pyrax.settings.set("region","ZZZ");pyrax.set_credentials("YYY","XXX");cf=pyrax.cloudfiles;cont=cf.get_container("CCC");cf.object_meta_prefix="";obj=cont.get_object("FFF");print "t1.JPG metadata before:", cf.get_object_metadata(cont,obj);cf.set_object_metadata(cont,obj,{"Access-Control-Allow-Origin":"www.test.com"},clear=False);print "t1.JPG metadata after:", cf.get_object_metadata(cont,obj)' 
    
    t1.JPG metadata before: {'content-length': '496987', 'accept-ranges': 'bytes', 'last-modified': 'Thu, 08 May 2014 13:51:09 GMT', 'etag': 'xxxxxxx, 'x-timestamp': '1399557068.10654', 'x-trans-id': 'tx9xxxxxxxxxxord1', 'date': 'Fri, 09 May 2014 00:56:43 GMT', 'access-control-allow-origin': 'www.othertest.com', 'content-type': 'image/jpeg'}
    
    t1.JPG metadata after: {'content-length': '496987', 'accept-ranges': 'bytes', 'last-modified': 'Thu, 08 May 2014 13:51:09 GMT', 'etag': 'xxxxx', 'x-timestamp': '1399557068.10654', 'x-trans-id': 'txcxxxxxxxxxxxxord1', 'date': 'Fri, 09 May 2014 00:56:51 GMT', 'access-control-allow-origin': 'www.othertest.com', 'content-type': 'image/jpeg'}
    [[email protected] ~]#
    
    opened by alexmsu75 27
  • Fresh ubuntu 12.04 install pyrax.set_credentials() failure

    Fresh ubuntu 12.04 install pyrax.set_credentials() failure

    Upon trying out pyrax I have fallen down on the first hurdle.

    pyrax.set_credentials("username", "token")
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 372, in _wrapped
        return fnc(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 430, in set_credentials
        _auth_and_connect(region=region)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 504, in _auth_and_connect
        connect_to_services(region=region)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 572, in connect_to_services
        cloudservers = connect_to_cloudservers(region=region)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 372, in _wrapped
        return fnc(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 384, in _wrapped
        return fnc(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 602, in connect_to_cloudservers
        _cs_auth_plugin.discover_auth_systems()
      File "/usr/local/lib/python2.7/dist-packages/novaclient/auth_plugin.py", line 40, in discover_auth_systems
        auth_plugin = ep.load()
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1988, in load
        if require: self.require(env, installer)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2001, in require
        working_set.resolve(self.dist.requires(self.extras),env,installer))
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
        raise DistributionNotFound(req)
    pkg_resources.DistributionNotFound: six
    

    six is installed in my python packages, upon trying to install an update of novaclient I get the following error.

    File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 372, in _wrapped
        return fnc(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 430, in set_credentials
        _auth_and_connect(region=region)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 504, in _auth_and_connect
        connect_to_services(region=region)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 572, in connect_to_services
        cloudservers = connect_to_cloudservers(region=region)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 372, in _wrapped
        return fnc(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 384, in _wrapped
        return fnc(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyrax/__init__.py", line 602, in connect_to_cloudservers
        _cs_auth_plugin.discover_auth_systems()
      File "/usr/local/lib/python2.7/dist-packages/novaclient/auth_plugin.py", line 40, in discover_auth_systems
        auth_plugin = ep.load()
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1988, in load
        if require: self.require(env, installer)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2001, in require
        working_set.resolve(self.dist.requires(self.extras),env,installer))
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
        raise DistributionNotFound(req)
    pkg_resources.DistributionNotFound: six >=1.4.1
    

    When using the latest novaclient six was upgraded to 1.5.2 how can I resolve this?

    opened by gringo2150 26
  • Pyrax CloudFiles extremely slow in threaded application

    Pyrax CloudFiles extremely slow in threaded application

    Hello,I have a threaded application, using queues, to read and write files from cloudfiles and I get weird time gaps at the end as the tasks run out. These gaps are anywhere from a couple of minutes to an hour. I am doing other processing that might be exacerbating the times a bit but I did a base test that only accesses Rackspace and found much the same results. Below is a simplified version of our code:

    pyrax.set_credentials(USERNAME, API_KEY)
    cfconn = pyrax.connect_to_cloudfiles(region=REGION, public=USE_PUBLIC)
    container = cfconn.create_container(HISTORY_CONTAINER)
    
    class RackspaceReader(threading.Thread):
    
        def __init__(self, max_tries, processing_queue):
            threading.Thread.__init__(self)
            self.max_tries = max_tries
            self.processing_queue = processing_queue
    
        def read(self, work):
            my_id    = work["item_id"]
    
            contents = None
            while tries < self.max_tries:
                try:
                    logger.info("Thread %s: Checking existing logs from rackspace." % self.name)
                    remote_file = container.get_object("%s\\%s.json" % (my_id, variable))
                    logger.info("Thread %s: Received existing logs sized %d bytes from rackspace." % (self.name, remote_file.total_bytes))
                    contents = remote_file.get()
                    logger.info("Thread %s: Read contents from files" % (self.name))
                except:
                    tries += 1
                    logger.error("Thread %s: Error reading logs from rackspace. Retrying attempt %d of %d" % (self.name, tries, self.max_tries))
    
            return contents
    
    
        def run(self):
            while True:
                try:
                    work = self.processing_queue.get(True, 1)
                    self.read(work)
                    self.processing_queue.task_done()
                except Queue.Empty:
                    continue
    
    
    if __name__ == "__main__":
    
        processing_queue = Queue.Queue()
    
        processing_pool = []
        for i in range(opts['reader_batches']):
            processing_thread = RackspaceReader(max_tries, processing_queue)
            processing_pool.append(processing_thread)
            processing_thread.setDaemon(True)
            processing_thread.start()
    
        for item in items:
            processing_queue.put({"item_id":     item_id})
    
        # As tasks become less, there is a larger and larger time gap for those still reading.
        processing_queue.join()
    
    enhancement 
    opened by mwidman 24
  • Installation error: [Exception: Versioning for this project requires...]

    Installation error: [Exception: Versioning for this project requires...]

    I installed for python 2.7 on OS X using both (1) the standard pip install pyrax and (2) the git version.

    Both ways, I receive the following error:

    Suggestions would be helpul. Thanks, ~John

    >>> import pyrax
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Library/Python/2.7/site-packages/pyrax/__init__.py", line 51, in <module>
        from .identity import *
      File "/Library/Python/2.7/site-packages/pyrax/identity/keystone_identity.py", line 7, in <module>
        from ..base_identity import BaseIdentity
      File "/Library/Python/2.7/site-packages/pyrax/base_identity.py", line 20, in <module>
        from pyrax import exceptions as exc
      File "/Library/Python/2.7/site-packages/pyrax/exceptions.py", line 22, in <module>
        from novaclient import exceptions as _nova_exceptions
      File "/Library/Python/2.7/site-packages/novaclient/__init__.py", line 18, in <module>
        __version__ = pbr.version.VersionInfo('python-novaclient').version_string()
      File "/Library/Python/2.7/site-packages/pbr/version.py", line 78, in version_string
        for part in self.release_string().split('.'):
      File "/Library/Python/2.7/site-packages/pbr/version.py", line 70, in release_string
        self.release = self._get_version_from_pkg_resources()
      File "/Library/Python/2.7/site-packages/pbr/version.py", line 62, in _get_version_from_pkg_resources
        return packaging.get_version(self.package)
      File "/Library/Python/2.7/site-packages/pbr/packaging.py", line 870, in get_version
        raise Exception("Versioning for this project requires either an sdist"
    Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
    
    opened by johnmrobinson 19
  • container.delete_all_objects() doesn't function properly

    container.delete_all_objects() doesn't function properly

    When using container.delete(del_objects=True) in my script, I kept getting HTTP 409 Conflict. Rackspace says this means the container is nonempty (verified with len(container.get_object_names()).

    I separated out my calls to container.delete_all_objects() and container.delete() and got a 409 Conflict again (which shouldn't happen as delete_all_objects() should block until completed (as per documentation - "By default the call will block until all objects have been deleted.").

    I then wrote in my own blocking with

    while len(container.get_object_names()):
        sleep(0.5)
    

    which never ends.

    I suspect that container.delete_all_objects() isn't doing what it says at least, and might not be doing anything.

    Also of note: I do have the following working, showing that I can delete objects individually with object.delete():

    objectNames = container.get_object_names();
    
    for name in objectNames:
        obj = container.get_object(name)
        obj.delete()
        # Block until object goes away.
        while obj:
            try:
                obj = container.get_object(name)
                time.sleep(0.5)
            except exc.NoSuchObject:
                obj = None
    
    opened by jeffcasavant 19
  • SSLError: bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)

    SSLError: bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)

    Attempting to use django-cumulus, and a fresh install yields:

    ERROR:root:Pyrax Connect Error in `django_cumulus.cumulus.authentication.Auth`::
                               self.pyrax.set_credentials(self.username, self.api_key)
    
    Traceback (most recent call last):
      File "/Environments/easy/local/lib/python2.7/site-packages/cumulus/authentication.py", line 51, in __init__
        self.pyrax.set_credentials(self.username, self.api_key)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/__init__.py", line 439, in _wrapped
        return fnc(*args, **kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/__init__.py", line 502, in set_credentials
        tenant_id=tenant_id, region=region, authenticate=authenticate)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/identity/rax_identity.py", line 68, in set_credentials
        region=region, tenant_id=tenant_id, authenticate=authenticate)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/base_identity.py", line 420, in set_credentials
        self.authenticate()
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/identity/rax_identity.py", line 83, in authenticate
        password=password, api_key=api_key, tenant_id=tenant_id)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/base_identity.py", line 599, in authenticate
        headers=headers, std_headers=False)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/base_identity.py", line 531, in method_post
        return self._call("POST", uri, admin, data, headers, std_headers)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/base_identity.py", line 570, in _call
        return pyrax.http.request(mthd, uri, verify=self.verify_ssl, **kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/pyrax/http.py", line 63, in request
        resp = req_method(uri, data=data, **kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/requests/api.py", line 107, in post
        return request('post', url, data=data, json=json, **kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/requests/api.py", line 53, in request
        return session.request(method=method, url=url, **kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/requests/sessions.py", line 468, in request
        resp = self.send(prep, **send_kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
        r = adapter.send(request, **kwargs)
      File "/Environments/easy/local/lib/python2.7/site-packages/requests/adapters.py", line 447, in send
        raise SSLError(e, request=request)
    SSLError: bad handshake: Error([('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')],)
    

    This appears to be a resurrection of https://github.com/rackspace/pyrax/issues/545

    opened by mnaglee 16
  • pyrax.set_credentials() throws pyrax.exceptions.IdentityClassNotDefined exception

    pyrax.set_credentials() throws pyrax.exceptions.IdentityClassNotDefined exception

    Authenticating with pyrax.set_credentials() seems to have broken in pyrax >=1.4.0. When I try to run code that worked with 1.3.9 I get the following exception:

    pyrax.exceptions.IdentityClassNotDefined: No identity class has been defined for the current environment.

    invalid 
    opened by mlew 16
  • parse.py string creation error

    parse.py string creation error

    I've just installed the latest version of pyrax on python3 (I did have the previous release but don't have the versions number to hand!)

    My code did work to upload but is now broken.

    The error I am getting is:

    Traceback (most recent call last):
      File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 2357, in <module>
        globals = debugger.run(setup['file'], None, None, is_module)
      File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1777, in run
        pydev_imports.execfile(file, globals, locals)  # execute the script
      File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
        exec(compile(contents+"\n", file, 'exec'), glob, loc) 
      File "/Users/alexhellier/Documents/git/web_assets/playground/__init__.py", line 42, in <module>
        main()
      File "/Users/alexhellier/Documents/git/web_assets/playground/__init__.py", line 32, in main
        upload = rs.upload_item('WebAssets', file)
      File "/Users/alexhellier/Documents/git/web_assets/playground/rackspace.py", line 37, in upload_item
        rsContainer = cf.get_container(container)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/object_storage.py", line 2250, in get
        item = super(StorageClient, self).get(item)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/client.py", line 98, in get
        return self._manager.get(item)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/object_storage.py", line 127, in wrapped
        return fnc(self, container, *args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/object_storage.py", line 816, in get
        return Container(self, data, loaded=False)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/object_storage.py", line 161, in __init__
        super(Container, self).__init__(*args, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/resource.py", line 52, in __init__
        self._add_details(info)
      File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyrax/resource.py", line 75, in _add_details
        setattr(self, key, val)
    TypeError: attribute name must be string, not 'bytes'
    

    I think I've traced this to parse.py

    Line 688 string = string.encode(encoding, errors)

    This is returning string = {bytes}b'/MyContainer

    and chucking the error above.

    Is this something that has changed

    I am 100% sending in the items as strings

    opened by Bobspadger 15
  • Syncing two containers

    Syncing two containers

    Is it possible to sync two folders in two different containers using pyrax? (or maybe some other way). I tried to use cloudfuse + rsync, but it seems to skip a lot of files (maybe because of errors)

    opened by romanoff 15
  • list() returns

    list() returns "BadRequest: n/a (HTTP 400)" for CloudDatabases and CloudLoadBalancers

    Hi,

    since 1.5.0:

    cdb = pyrax.cloud_databases
    cdb.list()
    

    and

    clb = pyrax.cloud_loadbalancers
    clb.list()
    

    I get BadRequest: n/a (HTTP 400), but that works with pyrax v1.4.11.

    curl request (pyrax.set_http_debug(True)) is the same in both the cases, apart from User-Agent value:

    curl -i https://lon.databases.api.rackspacecloud.com/v1.0/XXX/instances -X GET -H 'X-Auth-Project-Id: XXX' -H 'User-Agent: pyrax/1.5.0' -H 'Accept: application/json' -H 'X-Auth-Token: YYY

    Thanks,

    ~Simone

    opened by siso 14
  • Catch SSLErrors

    Catch SSLErrors

    I'm experiencing the same issues as: https://github.com/rackspace/python-cloudfiles/issues/34

    Here are 2 tracebacks. The first failed on making a container public. The 2nd failed on creating a new container.

    Traceback (most recent call last): File "./make_new_containers.py", line 82, in main() File "./make_new_containers.py", line 47, in main cont.make_public(ttl=86400) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/container.py", line 183, in make_public return self.client.make_container_public(self, ttl) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 630, in make_container_public return self._cdn_set_access(container, ttl, True) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 650, in _cdn_set_access response = self.connection.cdn_request(mthd, [ct.name], hdrs=hdrs) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 800, in cdn_request response = retry_request() File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 794, in retry_request return self.cdn_connection.getresponse() File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse response.begin() File "/usr/lib/python2.7/httplib.py", line 407, in begin version, status, reason = self._read_status() File "/usr/lib/python2.7/httplib.py", line 365, in _read_status line = self.fp.readline() File "/usr/lib/python2.7/socket.py", line 430, in readline data = recv(1) File "/usr/lib/python2.7/ssl.py", line 241, in recv return self.read(buflen) File "/usr/lib/python2.7/ssl.py", line 160, in read return self._sslobj.read(len) ssl.SSLError: The read operation timed out

    Traceback (most recent call last): File "./make_new_containers.py", line 79, in main() File "./make_new_containers.py", line 44, in main cont = cf.create_container(cont_name) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 32, in _wrapped return fnc(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 263, in create_container return self.get_container(name) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 32, in _wrapped return fnc(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 556, in get_container total_bytes=hdrs.get("x-container-bytes-used")) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/container.py", line 19, in init self._fetch_cdn_data() File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/container.py", line 25, in _fetch_cdn_data response = self.client.connection.cdn_request("HEAD", [self.name]) File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 800, in cdn_request response = retry_request() File "/usr/local/lib/python2.7/dist-packages/pyrax/cf_wrapper/client.py", line 794, in retry_request return self.cdn_connection.getresponse() File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse response.begin() File "/usr/lib/python2.7/httplib.py", line 407, in begin version, status, reason = self._read_status() File "/usr/lib/python2.7/httplib.py", line 365, in _read_status line = self.fp.readline() File "/usr/lib/python2.7/socket.py", line 430, in readline data = recv(1) File "/usr/lib/python2.7/ssl.py", line 241, in recv return self.read(buflen) File "/usr/lib/python2.7/ssl.py", line 160, in read return self._sslobj.read(len) ssl.SSLError: The read operation timed out

    opened by jyap808 14
  • Tenant_id parsing is not working due to different response from API_KEY authentication in some usser

    Tenant_id parsing is not working due to different response from API_KEY authentication in some usser

    https://github.com/pycontribs/pyrax/blob/a0c022981f76a4cba96a22ecc19bb52843ac4fbe/pyrax/base_identity.py#L631

    there are few token which do not generate the needed response

    {
      u'access': {
        u'token': {
          u'RAX-AUTH:authenticatedBy': [u'APIKEY'], 
          u'RAX-AUTH:issued': u'2022-09-08T07:07:07.616Z',
          u'expires': u'2022-09-09T06:58:44.616Z',
          u'id': '***REDACTED ***'
        },
    u'serviceCatalog': [{u'endpoints': [{u'region': u'IAD', u'publicURL': u'https://global.metrics.api.rackspacecloud.com/v2.0/***REDACTED ***', u'tenantId': u'hybrid:00000'}], u'type': u'rax:cloudmetrics', u'name': u'cloudMetrics'}, {u'endpoints': [{u'publicURL': u'https://monitoring.api.rackspacecloud.com/v1.0/hybrid:***REDACTED ***', u'tenantId': u'hybrid:***REDACTED ***'}], u'type': u'rax:monitor', u'name': u'cloudMonitoring'}], u'user': {u'RAX-AUTH:domainId': u'dedicated:***REDACTED ***', u'RAX-AUTH:phonePinState': u'ACTIVE', u'name': u'***REDACTED ***', u'roles': [{u'id': u'***REDACTED ***', u'description': u'Monitoring Admin Role for Account User', u'name': u'monitoring:admin', u'tenantId': u'hybrid:***REDACTED ***'}, {u'id': u'16', u'description': u'a role that allows a user access to dedicated service methods', u'name': u'dedicated:default', u'tenantId': u'hybrid:***REDACTED ***'}, {u'id': u'***REDACTED ***', u'description': u'A role to grant visibility to a tenant', u'name': u'identity:tenant-access', u'tenantId': u'hybrid:00000'}, {u'id': u'2', u'name': u'identity:default', u'description': u'Default Role.'}], u'RAX-AUTH:phonePin': u'***REDACTED ***', u'email': u'***REDACTED ***', u'RAX-AUTH:sessionInactivityTimeout': u'PT12H', u'RAX-AUTH:defaultRegion': u'IAD', u'RAX-AUTH:contactId': u'***REDACTED ***', u'id': ***REDACTED ***'}}}
    

    Values redacted to hide user detail but the response structure kept as it is

    File "/Users/bisw8246/Desktop/repos/py2devtoolsenv2/lib/python2.7/site-packages/pyrax/identity/rax_identity.py", line 83, in authenticate password=password, api_key=api_key, tenant_id=tenant_id) File "/Users/bisw8246/Desktop/repos/py2devtoolsenv2/lib/python2.7/site-packages/pyrax/base_identity.py", line 622, in authenticate self._parse_response(resp_body) File "/Users/bisw8246/Desktop/repos/py2devtoolsenv2/lib/python2.7/site-packages/pyrax/identity/rax_identity.py", line 123, in _parse_response super(RaxIdentity, self)._parse_response(resp) File "/Users/bisw8246/Desktop/repos/py2devtoolsenv2/lib/python2.7/site-packages/pyrax/base_identity.py", line 631, in _parse_response self.tenant_id = token["tenant"]["id"]

    opened by biswazr 2
  • TypeError __init__() got an unexpected keyword argument 'username'

    TypeError __init__() got an unexpected keyword argument 'username'

    Hello I've been using duplicity and pyrax for years for my backups to hubic. Unfortunately, the backend seems broken since I updated to debian 11 and python3 for pyrax.

    I first got the following error:

    File "/usr/lib/python3/dist-packages/duplicity/backends/pyrax_identity/hubic.py", line 35, in <module>
    class HubicIdentity(BaseIdentity):
    NameError: name 'BaseIdentity' is not defined
    

    Which I solved by installing duplicity (0.8.21-1) from unstable repository.

    However I now get another error: Connection failed, please check your credentials: TypeError __init__() got an unexpected keyword argument 'username'

    Can you please help me with this issue ? Thanks.

    opened by fab128 0
  • Release the latest code as 1.9.9

    Release the latest code as 1.9.9

    the last release 1.9.8 was done few years back, since then there have been lots of changes in the codebase but nothing was released, can you please release the latest version

    opened by maqzee-git 1
  • why cant install wrapt module

    why cant install wrapt module

    I need help, I cant install wrapt module using pip,then tried by manual but i find a proper wrapt module manual installing which is in the format of "whl"

    opened by saninkiliyamannil 0
  • rackspacesdk doesn't work

    rackspacesdk doesn't work

    As pyrax is deprecated in favor of rackspacesdk, I tried using rackspace SDK, and after working around a couple of build issues, I ran into a new issue with rackspace SDK.

    ~ $ pip-run -q --use-pep517 rackspacesdk setuptools -- -c "from rackspace import connection"                                                                              
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-l0k22gpq/rackspace/connection.py", line 16, in <module>
        from rackspace import profile as _profile
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-l0k22gpq/rackspace/profile.py", line 13, in <module>
        from openstack import profile
    ImportError: cannot import name 'profile' from 'openstack' (/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-l0k22gpq/openstack/__init__.py)
    
    

    Following the PyPI project to its homepage led me to Rackspace's API page, which led me here. I'm not even sure where the source code is for rackspacesdk. Please let me know if there's a better place where I can report issues with rackspacesdk.

    opened by jaraco 1
  • pyrax.exceptions.NotFound: No CloudDNSDomain matching: {'name': u'com'}. (HTTP 404)

    pyrax.exceptions.NotFound: No CloudDNSDomain matching: {'name': u'com'}. (HTTP 404)

    Getting the following error when running letsencrypt with rackspace hook, can anyone help please?

    • Rackspace hook executing: deploy_challenge Traceback (most recent call last): File "/home/jenkins/lets-encrypt-python-master/le_hook.py", line 196, in main(sys.argv[1:]) File "/home/jenkins/lets-encrypt-python-master/le_hook.py", line 192, in main opsargv[0] File "/home/jenkins/lets-encrypt-python-master/le_hook.py", line 108, in create_txt_record domain = get_domain(domain_name) File "/home/jenkins/lets-encrypt-python-master/le_hook.py", line 96, in get_domain domain = rax_dns.find(name=base_domain_name) File "/usr/local/anaconda2/lib/python2.7/site-packages/pyrax/client.py", line 118, in find return self._manager.find(**kwargs) File "/usr/local/anaconda2/lib/python2.7/site-packages/pyrax/manager.py", line 269, in find raise exc.NotFound(404, msg) pyrax.exceptions.NotFound: No CloudDNSDomain matching: {'name': u'com'}. (HTTP 404)
    • remove_lock
    • rm -f config/lock
    opened by skalangi-clh 0
Releases(v1.10.0)
  • v1.10.0(Apr 7, 2021)

    Long time since the last release. This is to just start the ball rolling again.

    • initial Python 3 support
    • fix some doc issues
    • switch to GitHub flow for contributions
    • switch from Travis CI to GitHub Actions
    Source code(tar.gz)
    Source code(zip)
  • v1.9.8(Aug 22, 2016)

  • v1.9.7(Mar 2, 2016)

    There are no changes in this version from v1.9.6. The version was bumped to handle a packaging issue. See the RELEASENOTES.md file for a complete list of changes.

    Source code(tar.gz)
    Source code(zip)
  • v1.9.6(Jan 19, 2016)

  • v1.9.5(Jan 19, 2016)

  • v1.9.4(Apr 16, 2015)

  • v1.9.3(Nov 21, 2014)

  • v1.9.2(Aug 20, 2014)

  • v1.9.1(Aug 18, 2014)

  • v1.9.0(Jul 15, 2014)

    2014.07.14 - Version 1.9.0

    • Cloud Files / Swift
      • Removed dependency on python-swiftclient
      • Ensured that URIs are properly encoded and quoted.
      • Improved verbose output for sync_folder_to_container().
      • CDN-related attributes were sometimes not initialized correctly. GitHub #399 and #423
      • Fixed case where passing async=True to bulk_delete() was ignored. GitHub #398
    • General
      • Fixed case where envronment variables are improperly ignored.
      • Fixed missing 'connect' param in identity authenticate().
      • Added support for different auth_endpoint values when using Rackspace authentication.
    • Cloud Servers / Nova
      • Load extenstions already installed in the local novaclient. GitHub #425
      • Made sure that 'personality' files are properly base-64 encoded.
    • Cloud Images / Glance
      • Added the find_images_by_name() method to list images by case-insensitive partial name matches.
    • Autoscale
      • Updated update_launch_config(). The 'flavorRef' variable was being incorrectly set to None.
      • Fixed 400 error when not including a personality file value.
    • Cloud Networks
      • The networks client was not being returned in cases where novaclient had already been created, due to incorrect caching of clients. GitHub #406
    • Cloud Load Balancers
      • Made get_stats() call available from the LB. GitHub #394
    Source code(tar.gz)
    Source code(zip)
  • v1.8.2(Jun 4, 2014)

    2014.06.04 - Version 1.8.2

    • General
      • Changed copyright notices to match the standard by Rackspace Legal.
      • Clear old api_key values when re-authenticating. GitHub #383
    • Cloud Files
      • Fixes issue with non-CDN containers. GitHub #254
      • Fixed the subdir listing for Cloud Files. GitHub #342
      • Added a method to fetch DLOs from object storage.
      • Added option for specifying headers. GitHub #374
    • Cloud Monitoring
      • Updated the code to use the pyrax.http module.
    • Cloud Networks
      • Added special handling for RAX networks. GitHub #381
    Source code(tar.gz)
    Source code(zip)
  • v1.8.1(May 13, 2014)

    2014.05.13 - Version 1.8.1

    • General
      • Restored module-level regions and services attributes. GitHub #371
      • Improved error message when calling get_client when not authenticated. GitHub #369
    • Identity
      • Added the ability to request multiple clients. GitHub #370
      • Modified list_tenants() function to take an admin argument. GitHub #352
      • Fixed service catalog parsing. GitHub #361
    • Cloud Files
      • Added aliases to make Cloud Files method names more consistent. GitHub #373
      • Added missing limit/marker parameters. GitHub #349
      • Added code to check for CDN before making CDN calls.
      • Made the meta prefixes read-only. GitHub #365
      • Added 'prefix' parameter to get/set metadata commands. GitHub #367
      • Added chunking to put_object()
      • Fixed old cloudfiles reference. GitHub #362
      • Fixed unit tests for CDN changes.
    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(May 6, 2014)

    2014.05.06 - Version 1.8.0

    • Identity
      • Added Context Objects as a way to encapsulate an authenticated session.
      • Context objects remove the limitation in pyrax of only working with a single authenticated session at a time.
      • Improves the ability to work with multiple providers at once, or across multiple regions for the same provider.
      • More information in the context_objects.md document in the docs/ folder.
    • Cloud Files
      • Fixed missing URL quoting for bulk deletes. GitHub #350
      • Multiple improvements to sync_folder_to_container in GitHub #355:
        • Added the ability to specify a prefix to be added to the object name during checking and uploading during a sync
        • Sped up sync_folder_to_container by having it pull down a list of objects all at once to use to compare against instead of checking once for each file.
        • Added verbose logging to sync_folder_to_container (Originally requested in GitHub #250)
    • General
      • Fixed issue where one bad section in the configuration file caused threw an exception that terminated your app. GitHub #346
      • Removed the need to specify a tenant_id when authenticating with a token. GitHub #345
    • Block Storage
      • Added missing update methods to Cloud Block Storage.
    • Documentation
      • Updated the queues docs to include listing of queues. GitHub #353
    Source code(tar.gz)
    Source code(zip)
  • v1.7.3(Apr 7, 2014)

    2014.04.07 - Version 1.7.3

    • Identity
      • Updated the identity module and tests to work with the new http library.
        GitHub #333
    • General
      • Fixed some log debug issues.
      • Removed locale test, as it is unreliable at best.
    • Cloud Files
      • Round up the datetime in seconds in convert_list_last_modified to match
        the behaviour in https://review.openstack.org/#/c/55488/. GitHub #337
      • Fixed ValueError when handling a bulk delete response. GitHub #335
    Source code(tar.gz)
    Source code(zip)
  • v1.7.2(Mar 30, 2014)

  • v1.7.1(Mar 28, 2014)

    2014.03.28 - Version 1.7.1

    • General
      • Added a CONTRIBUTING.rst file, following the suggestion of @justinclift in GitHub #327.
      • Removed dependecy on the httplib2 library; pyrax now only relies on the 'requests' module for HTTP communication.
      • Fixed a bug in folder size calculations. GitHub #302
      • Removed a limit that only handled Rackspace vendor extensions. GitHub #315
      • Updated the setup.py version requirements for the 'requests' and 'six' libraries. GitHub #314
      • Updated utility calls to reflect new names. GitHub #312
    • Documentation
      • Minor typo correction. GitHub #326
      • Updated docs for better region coverage. GitHub #324 and #316
      • Updated network limits in docs. GitHub #322
    • Images
      • Sample code for accepting images that were shared add_image_member.py. GitHub #318
    • Cloud Files
      • Fixed (yet again) the ability to turn on/off debug output after another change in the underlying swiftclient library. GitHub #317
    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Mar 12, 2014)

    2014.03.12 - Version 1.7.0

    • New:
      • Added support for Cloud Images (Glance).
        • Import/export your compute images across different data centers, or even different providers.
        • Share your images with other accounts.
    • Queues:
      • Fixed limit bug for queue messages. GitHub #309
    • General
      • Many Python 3 compatibility improvements.
        • Not fully compatible yet, but getting closer.
      • Fixed config file pathing problem on Windows. GitHub #306
      • Fixed issue where non-401 exceptions were suppressed. GitHub #310
    Source code(tar.gz)
    Source code(zip)
  • v1.6.4(Feb 24, 2014)

    2014.02.24 - Version 1.6.4

    • Cloud Block Storage:
      • Added support for volume cloning.
    • Cloud Files:
      • Added support for bulk deletes > 10K objects. GitHub #286
      • Fixed edge case with object size == max chunk size. GitHub #287
    • General:
      • Added support for identity modules outside of pyrax. GitHub #292
    • Testing:
      • Moved fakes.py into pyrax module to enable easier testing from other
        projects. GitHub #288
    • Docs:
      • Fixed several typos. GitHub #296 & #296.
    • Autoscale:
      • Removed default of AUTO for diskConfig from Autoscale.
    Source code(tar.gz)
    Source code(zip)
  • v1.6.3(Feb 3, 2014)

    2014.02.03 - Version 1.6.3

    • Cloud Monitoring:
      • Added back missing error info. GitHub #285
      • Added support for Overviews and Changelogs from Cloud Monitoring. GitHub #267
    • Autoscale:
      • Corrected how networks are created when none are specified. GitHub #262
      • Added load balancers to sample code for creating a scaling group.
      • Fixed bug in autoscale group creation. GitHub #249 and #203
    • Queues:
      • Removed default TTL when posting messages to a queue. GitHub #265
    • Cloud Files:
      • Add use_servicenet setting for Cloud Files. GitHub #273
      • Fixed bug in passing TTL to delete_in_seconds(). GitHub #281
      • Added a fix for GETting 0-byte content with Dynamic Large Objects (multipart files). GitHub #258
      • Include container name in X-Object-Manifest header when creating DLO. GitHub #261
      • Use X-Object-Manifest instead of X-Object-Meta-Manifest when creating DLO. GitHub #260
    • Cloud Load Balancers:
      • Added httpsRedirect param for Cloud Load Balancers. GitHub #277
      • Adding an entry for the id attribute to the Node's to_dict() method. GitHub #276
    • Cloud DNS:
      • Handle empty bodies in GET responses from the Cloud DNS API. GitHub #280
    • Cloud Servers:
      • Updated docs and samples to eliminate old flavor references.
    • General:
      • Add requests as installation requirement. GitHub #269
    Source code(tar.gz)
    Source code(zip)
  • v1.6.2(Feb 3, 2014)

    2013.11.13 - Version 1.6.2

    • Cloud Databases:
      • Added missing 'host' parameter. GitHub #246
    • Cloud Queues:
      • Removed requirement for Client ID for non-message requests. GitHub #244
      • Added support for ServiceNet queues. GitHub #240
      • Added the claim_id parameter to message deletion calls. GitHub #243
      • Fixed a bug when parsing message and claim IDs.
      • Made several corrections in the docs. - Cloud DNS:
      • Added handling for an occasional empty body when polling a running request. GitHub #237
    • General:
      • Added support for Python Wheel distribution
      • Fixed missing file spec in MANIFEST.in
      • Removed unneeded files
    Source code(tar.gz)
    Source code(zip)
  • v1.6.1(Feb 3, 2014)

    2013.10.31 - Version 1.6.1

    • Cloud Databases:
      • Added support for Backups. GitHub #216
      • Added ability to specify 'host' parameter for users. GitHub #229
      • Added ability to update users.
    • Queues:
      • Removed default TTL for messages. GitHub #234
    • Cloud Files:
      • Fixed large file upload bug. GitHub #231
      • Fixed file naming bug. GitHub #232
    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(Feb 3, 2014)

    2013.10.24 - Version 1.6.0

    • New:
      • Added support for Cloud Queues (Marconi).
    • Cloud Files:
      • Fixed an issue where the last_modified datetime values for Cloud Files storage_objects were returned inconsistently.
      • Added ability to cache temp_url_key. GitHub #221
      • Added ability to do partial downloads. GitHub #150
      • Fixed an issue where calling delete_object_in_seconds() deleted existing metadata. GitHub #135
    • Cloud Databases:
      • Added missing pagination parameters to several methods. GitHub #226
    • Cloud DNS:
      • Changed the findall() method to be case-insensitive.
      • Fixed some error-handling issues. GitHub #219
    • Auto Scale:
      • Added code to force 'flavor' arguments to str type.
      • Fixed creation/retrieval of webhooks with policy ID.
      • Added several replacement methods for configurations.
    • Load Balancers:
      • Removed requirement that nodes be passed when creating a load balancer. GitHub #222
    • Testing:
      • Improved the smoketest.py integrated test script by adding more services.
      • Fixed the smoketest to work when running in multiple regions that don't all offer the same services.
    • General:
      • Refactored the _create_body() method from the BaseClient class to the BaseManager class.
    Source code(tar.gz)
    Source code(zip)
Owner
PyContribs
PyContribs main purpose is to assure that different Python-related projects remain maintained.
PyContribs
Auslesen, entschlüsseln und parsen von Smart Meter Telegrammen

Netz-NÖ SmartMeter-P1-Reader https://www.netz-noe.at/Download-(1)/Smart-Meter/218_9_SmartMeter_Kundenschnittstelle_lektoriert_14.aspx Dieses Skript en

3 Jan 14, 2022
Mikasa is a 100% Spanish bot, a multifunctional bot, Mikasa is in beta.

Mikasa Miaksa, It is a multi-functional discord bot that is currently in development, this is not complete, there are still many things to fix and imp

Made in 2 Oct 05, 2021
Cogs version of iso6.9 with the help of thatOneArchUser

iso6.9-cogs (debloated) This is a cogs version of iso6.9 by αrchιshα#5518. iso6.9 is a Discord bot written in Python and is used to make your Discord

Kamilla Youver 2 Jun 10, 2022
Example app to be deployed to AWS as an API Gateway / Lambda Stack

Disclaimer I won't answer issues or emails regarding the project anymore. The project is old and not maintained anymore. I'm not sure if it still work

Ben 123 Jan 01, 2023
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
Schedule Twitter updates with easy

coo: schedule Twitter updates with easy Coo is an easy to use Python library for scheduling Twitter updates. To use it, you need to first apply for a

wilfredinni 46 Nov 03, 2022
Upbit(업비트) Cryptocurrency Exchange OPEN API Client for Python

Base Repository Python Upbit Client Repository Upbit OPEN API Client @Author: uJhin @GitHub: https://github.com/uJhin/upbit-client/ @Officia

Yu Jhin 37 Nov 06, 2022
Freqtrade 3commas wrapper for python

Freqtrade 3commas wrapper The aim of this project is to provide an easy way to integrate freqtrade with 3commas. The main reason someone would want to

Alex Babescu 43 Dec 17, 2022
WhatsAppCrashingToolv1.1 - WhatsApp Crashing Tool v1.1

WhatsAppCrashingTool v1.1 This is just for Educational Purpose WhatsApp Crashing

E4crypt3d 3 Dec 20, 2022
数字货币动态趋势网格,随着行情变动。目前实盘月化10%。目前支持币安,未来上线火币、OKEX。

数字货币动态趋势网格,随着行情变动。目前实盘月化10%。目前支持币安,未来上线火币、OKEX。

幸福村的码农 98 Dec 27, 2022
Huggingface transformers for discord

disformers Huggingface transformers for discord base source butyr/huggingface-transformer-chatbots install pip install -U disformers example see examp

SpaceDEVofficial 1 Nov 09, 2021
Signs API calls to SberCloud.Advanced with AK/SK

sbercloud-api-aksk Signs API calls to SberCloud.Advanced with AK/SK This script is a courtesy of @sadpdtchr Description Sometimes there is a need to m

Peter Predtechensky 1 Nov 30, 2021
Start multiple bots using one script. VK RAID BOTNET

MultiRaidBotnet Start multiple bots using one script. VK RAID BOTNET Русский launcher.py - главный скрипт, запускающий весь ботнет config.py - в нём х

2 Jul 22, 2022
send sms via grafana alert webhook

notifier fire alarm What does this project do: the aim of this project is to send alarm notification from grafana alert manager via kavenegar api. sta

Ali Soltani 4 Oct 20, 2021
Mventory is an API-driven solution for Makerspaces, Tinkerers, and Hackers.

Mventory is an API-driven inventory solution for Makers, Makerspaces, Hackspaces, and just about anyone else who needs to keep track of "stuff".

Make Monmouth 107 Dec 21, 2022
Export Statistics for a Telegram Group Chat

Telegram Statistics Export Statistics for a Telegram Group Chat How to Run First, in main repo directory, run the following code to add src to your PY

Ali Hejazizo 22 Dec 05, 2022
Injector/automatic translator (using deepL API) for Tsukihime Remake

deepLuna Extractor/Editor/Translator/Injector for Tsukihime Remake About deepLuna, from "deepL", the machine translation service, and "Luna", the name

30 Dec 15, 2022
Search twitter by address.

Twitter Geolocate Twitter Geolocation is a console app that generates twitter search querries for a certain geolocation and opens them in your standar

David J. Kowalk 28 Dec 06, 2022
PyMusic Player is a music player written in python3.

PyMusic Player is a music player written in python3. It harvests r

PythonSerious 2 Jan 30, 2022
A pixeldrain python package using pixeldrain official api

Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/FayasNoushad/Pixeldrain/blob/main/LICENSE In

Fayas Noushad 6 Jan 26, 2022