{ "info": { "author": "Launchpad developers", "author_email": "launchpad-devs@lists.launchpad.net", "bugtrack_url": null, "classifiers": [], "description": "python-oops-dictconfig\n======================\n\nCreate an `oops.Config` object from a definition encoded as a dictionary.\n\nDependencies\n------------\n\n * python-oops (http://pypi.python.org/pypi/oops)\n\nAlso the following dependencies are required depending on the configs\nyou will use:\n\n * python-oops-datedir-repo (http://pypi.python.org/pypi/oops_datedir_repo)\n * python-oops-amqp (http://pypi.python.org/pypi/oops_datedir_repo)\n\nFor testing all of the above are needed, along with:\n\n * python-testtools\n\nUse\n---\n\nTo use run::\n\n from oops_dictconfig import config_from_dict\n\n oops_config = config_from_dict(dict_config)\n\nwhere `dict_config` is a `dict` describing the `oops.Config` that is\nwanted.\n\nThe empty dict is valid, and will get you an `oops.Config` with\nno publishers, however, you will usually want at least one publisher.\n\nTo do that have a `publishers` key in `dict_config` whose value is a list\nof dicts. Each of those dicts will add a publisher to the `oops.Config`.\n\nThere is one mandatory key for all publisher types:\n\n * type: the type of publisher, currently `\"datedir\"` and `\"amqp\"` are\n supported.\n\nAll publishers support the following (deprecated) optional key. Instead of\nusing this, you should see the section on fallback publishers:\n\n * new_only: if this is `True` then the publisher will be wrapped in\n `oops.publish_only_new`, meaning that the oops will only\n be sent to this publisher if no previous publisher in the\n chain published it.\n\nEach publisher type also has further options detailed below.\n\ndatedir\n```````\n\nThere is one further mandatory key for the datedir publisher:\n\n * error_dir: the path on filesystem where the oops should be written.\n It doesn't need to already exist.\n\nThe following optional keys are also supported:\n\n * inherit_id: If True, use the oops ID (if present) supplied in\n the report, rather than always assigning a new one.\n * stash_path: If True, the filename that the OOPS was written to\n is stored in the OOPS report under the key 'datedir_repo_filepath'.\n It is not stored in the OOPS written to disk, only the in-memory\n model.\n\namqp\n````\n\nThere are several other mandatory keys for the amqp publisher:\n\n * host: the hostname of the AMQP broker to connect to. If a port\n is needed then specify it after the hostname, separated by\n a colon. Examples: `example.com`, `1.2.3.4:5022`.\n\n * user: the username to use when connecting to the AMQP broker.\n\n * password: the password to use when connecting to the AMQP broker.\n\n * vhost: the vhost to send messages on the AMQP broker.\n\n * exchange_name: The name of the exchange to publish to.\n\n * routing_key: The routing key for messages.\n\nThere is one other optional key for the amqp publisher:\n\n * inherit_id If True any 'True' 'id' in an OOPS report is\n preserved. Handy if an id that has already been shown\n to a user is being published (but uniqueness cannot be\n guaranteed).\n\nFallback publishers\n-------------------\n\nSometimes it is desirable to have a chain of publishers, where the next in\nthe chain is used if the current attempt reported failure. For example, you\ncan have an amqp publisher with a datedir fallback, so that if the amqp\nbroker is not reachable the oops are saved to a datedir, where they can\nbe forwarded later.\n\nTo do this create a publisher definition with a 'fallback_chain' key,\nwhose value is a list of publishers to chain, e.g.\n\n {\n 'fallback_chain': [\n {'type': 'amqp',\n ...\n },\n {'type': 'datedir',\n ...\n }\n ]\n }\n\nNote that these chains can't be nested, so 'fallback_chain' can only appear\nat the top level of the publishers list.\n\nExamples\n--------\n\nThe following would create a DateDirRepo as the only publisher::\n\n {\n 'publishers': [\n {\n 'type': 'datedir',\n 'error_dir': '/var/log/oopses/',\n },\n ],\n }\n\nThe following is a simple config for an AMQP publisher::\n\n {\n 'publishers': [\n {\n 'type': 'amqp',\n 'host': 'amqp.example.com:5302',\n 'user': 'oopsuser',\n 'password': 'oopspassword',\n 'vhost': 'oopses',\n 'exchange_name': 'oopses',\n 'routing_key': 'oopses',\n },\n ],\n }\n\nThe following is an example that publishes to AMQP with a fallback\nto DateDirRepo if AMQP is not availble::\n\n {\n 'publishers': [\n {\n 'fallback_chain': [\n {\n 'type': 'amqp',\n 'host': 'amqp.example.com:5302',\n 'user': 'oopsuser',\n 'password': 'oopspassword',\n 'vhost': 'oopses',\n 'exchange_name': 'oopses',\n 'routing_key': 'oopses',\n },\n {\n 'type': 'datedir',\n 'error_dir': '/var/log/oopses/',\n },\n ],\n },\n ],\n }\n\n\nTemplate\n--------\n\nYou can set the template for oopses by adding a 'template' key to\nthe dict. This should itself be a dict mapping keys to default values.\nThe template will then be used by the config when creating oopses.\n\nThe most common use of this is to set the publisher for oopses\ncoming from that config::\n\n {\n 'template': {\n 'publisher': 'myapp',\n },\n }\n\n\nconfigglue\n----------\n\nIf you are using configglue to manage your configuration an Option\nsubclass is supplied that can be used in your schema as appropriate::\n\n from configglue import schema\n from oops_dictconfig.configglue import OopsOption\n\n class MySchema(schema.Schema):\n\n oopses = OopsOption()\n\n\nOnce that is defined you can produce the config described above\nusing your configglue config file::\n\n oopses = oopses_config\n\n [oopses_config]\n publishers = fallback_chain\n\n [fallback_chain]\n fallback_chain = amqp_publisher\n datedir_publisher\n\n [amqp_publisher]\n type = amqp\n host = amqp.example.com:6832\n user = oopsuser\n password = oopspassword\n vhost = oopses\n exchange_name = oopses\n routing_key = oopses\n\n [datedir_publisher]\n type = datedir\n error_dir = /var/log/oopses\n\n\nRunning Tests\n-------------\n\nInstall `testrepository` and `python-subunit` and run::\n\n testr init\n testr run\n\nor run::\n\n python -m testtools.run oops_dictconfig.tests.test_suite\n\n\n..\n\n Copyright (c) 2012, Canonical Ltd\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, version 3 only.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with this program. If not, see .\n GNU Lesser General Public License version 3 (see the file LICENSE).", "description_content_type": null, "docs_url": null, "download_url": "https://launchpad.net/python-oops-dictconfig/+download", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://launchpad.net/python-oops-dictconfig", "keywords": null, "license": "LGPLv3", "maintainer": null, "maintainer_email": null, "name": "oops_dictconfig", "package_url": "https://pypi.org/project/oops_dictconfig/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/oops_dictconfig/", "project_urls": { "Download": "https://launchpad.net/python-oops-dictconfig/+download", "Homepage": "http://launchpad.net/python-oops-dictconfig" }, "release_url": "https://pypi.org/project/oops_dictconfig/0.0.6/", "requires_dist": null, "requires_python": null, "summary": "Create an oops Config from a definition encoded as a dict", "version": "0.0.6" }, "last_serial": 1822342, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b3064761eedd1de08181355166e0a8dc", "sha256": "92957ef0fd54686593021ed8f44446a0e937f51d95d115f5614419f3a61b5115" }, "downloads": -1, "filename": "oops_dictconfig-0.0.1.tar.gz", "has_sig": true, "md5_digest": "b3064761eedd1de08181355166e0a8dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8947, "upload_time": "2012-02-07T20:48:35", "url": "https://files.pythonhosted.org/packages/59/8a/847190837a69f0666e0088110500c83d146fb1088226f61e16f5e8ab5beb/oops_dictconfig-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "af898e057b9f670aa9757e73ac85a932", "sha256": "10d92ff67a32856997e80f4f5d8a93ea9a0d06b65ce5a72851a476256be2bb07" }, "downloads": -1, "filename": "oops_dictconfig-0.0.2.tar.gz", "has_sig": true, "md5_digest": "af898e057b9f670aa9757e73ac85a932", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9491, "upload_time": "2012-06-07T21:46:18", "url": "https://files.pythonhosted.org/packages/63/3b/1cfa02e3912c5441786033384f4694037d8280bb97943a59e58e218ea8bf/oops_dictconfig-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2c71d88177364d54c83e23274a3fb8a0", "sha256": "554777e822bd1a44126ce68ed468bda34177b2597fe635a1eb6bf8912fc5a5b6" }, "downloads": -1, "filename": "oops_dictconfig-0.0.3.tar.gz", "has_sig": true, "md5_digest": "2c71d88177364d54c83e23274a3fb8a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8884, "upload_time": "2013-02-21T16:07:22", "url": "https://files.pythonhosted.org/packages/47/cf/bbb02365826813701b3878140a228bb060bd3656112963cbd4cf1ec71b79/oops_dictconfig-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "e8e76256e5413bd6d6a1b514f78a9340", "sha256": "2000887dec46d7a9f16e70b4b00f878799e9ee038aca9d3a8817fc9efe4d3315" }, "downloads": -1, "filename": "oops_dictconfig-0.0.4.tar.gz", "has_sig": true, "md5_digest": "e8e76256e5413bd6d6a1b514f78a9340", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8976, "upload_time": "2013-02-21T18:20:00", "url": "https://files.pythonhosted.org/packages/e1/54/9764672a5a322597f68c77564482ba5622eb673cab279a77b1212a65fa50/oops_dictconfig-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "ca049124de50a0a159ab00abaf6b642a", "sha256": "b8a50d524d5673632b83d61eced37729813340b57db8043e7370821ec0d177a7" }, "downloads": -1, "filename": "oops_dictconfig-0.0.5.tar.gz", "has_sig": true, "md5_digest": "ca049124de50a0a159ab00abaf6b642a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9017, "upload_time": "2013-02-26T16:30:34", "url": "https://files.pythonhosted.org/packages/b8/c5/7cccd96d94b94bc2092cad146ae467bbdf28f429663872dda59fcb5753d9/oops_dictconfig-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "301741071af4f4ff46d005266ffaad05", "sha256": "e6072139bf387063299e9682a0e3c02b1dd6f1213ad16185a90de4921110f521" }, "downloads": -1, "filename": "oops_dictconfig-0.0.6.tar.gz", "has_sig": false, "md5_digest": "301741071af4f4ff46d005266ffaad05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10863, "upload_time": "2015-11-18T11:04:48", "url": "https://files.pythonhosted.org/packages/9c/ed/118d2ada6772b8c5ce880da8e21aacf7e30612caae5d6a2c8b2fce409261/oops_dictconfig-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "301741071af4f4ff46d005266ffaad05", "sha256": "e6072139bf387063299e9682a0e3c02b1dd6f1213ad16185a90de4921110f521" }, "downloads": -1, "filename": "oops_dictconfig-0.0.6.tar.gz", "has_sig": false, "md5_digest": "301741071af4f4ff46d005266ffaad05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10863, "upload_time": "2015-11-18T11:04:48", "url": "https://files.pythonhosted.org/packages/9c/ed/118d2ada6772b8c5ce880da8e21aacf7e30612caae5d6a2c8b2fce409261/oops_dictconfig-0.0.6.tar.gz" } ] }