We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Model up yaml configs from the DB
Various yaml configs are stored in the database, including the one we'll most likely want to imspect, which is the vmdb config.

The schema, for our purposes, is two fields in the `configurations` table, `typ` and `settings`. The interface that I'm leaning toward is configurations[typ] = dictified_yaml(settings), if that makes sense. 

So, for example, if we wanted to see whether or not to get a list of public images from ec2, the lookup would be `configurations['vmdb']['ems_refresh']['ec2']['get_public_images']`


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `fixtures/cfmedb.py`
Content:
```
1 '''
2 
3 
4 Created on Jun 14, 2013
5 
6 @author: bcrochet
7 
8 '''
9 # -*- coding: utf-8 -*-
10 # pylint: disable=C0103
11 # pylint: disable=E1101
12 import pytest
13 from urlparse import urlparse
14 from sqlalchemy import create_engine
15 from sqlalchemy.orm import sessionmaker
16 import ConfigParser
17 
18 def pytest_addoption(parser):
19     '''Create the options for py.test'''
20     config = ConfigParser.ConfigParser(defaults={
21         'cfmedburl': ''
22     })
23     config.read('cfme.cfg')
24 
25     group = parser.getgroup('cfme', 'cfme')
26     group.addoption('--cfmedburl',
27                      action='store',
28                      dest='cfme_db_url',
29                      default=config.get('DEFAULT', 'cfmedburl'),
30                      metavar='url',
31                      help='url for CFME database to connect to')
32 
33 def pytest_sessionstart(session):
34     '''Setup run for tests'''
35     import db
36     db.cfme_db_url = session.config.option.cfme_db_url
37     if not db.cfme_db_url:
38         # Let's try to figure it out
39         baseurl = session.config.option.base_url
40         baseip = urlparse(baseurl).hostname
41         db.cfme_db_url = "postgres://root:smartvm@%s:5432/vmdb_production" \
42                 % baseip
43     db.engine = create_engine(db.cfme_db_url)
44 
45 @pytest.fixture
46 def db_session():
47     '''Creates a database session based on the db url passed on the CLI
48 
49     Usage example:
50 
51     This is a SQLalchemy (http://www.sqlalchemy.org/) session. You can make
52     queries and create new rows in the database with this session.
53 
54     The available classes are dynamically generated from the database. Consult
55     db/__init__.py for a list of available class -> table mappings.
56 
57     An example test:
58 
59     @pytest.mark.nondestructive
60     def test_that_tries_for_db(db_session):
61         import db
62         session = db_session
63         for instance in session.query(db.ExtManagementSystem).order_by(
64             db.ExtManagementSystem.id):
65         print instance.name, instance.hostname
66 
67     This 'test' prints the management systems from the database.
68     '''
69     import db
70     Session = sessionmaker(bind=db.engine)
71     return Session()
72 
73
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/fixtures/cfmedb.py b/fixtures/cfmedb.py
--- a/fixtures/cfmedb.py
+++ b/fixtures/cfmedb.py
@@ -70,3 +70,13 @@
     Session = sessionmaker(bind=db.engine)
     return Session()
 
+@pytest.fixture
+def db_yamls(db_session):
+    '''Returns the yamls from the db configuration table as a dict'''
+
+    import db
+    import yaml
+    configs = db_session.query(db.Configuration.typ, db.Configuration.settings)
+    data = {name: yaml.load(settings) for name, settings in configs}
+
+    return data

{"golden_diff": "diff --git a/fixtures/cfmedb.py b/fixtures/cfmedb.py\n--- a/fixtures/cfmedb.py\n+++ b/fixtures/cfmedb.py\n@@ -70,3 +70,13 @@\n     Session = sessionmaker(bind=db.engine)\n     return Session()\n \n+@pytest.fixture\n+def db_yamls(db_session):\n+    '''Returns the yamls from the db configuration table as a dict'''\n+\n+    import db\n+    import yaml\n+    configs = db_session.query(db.Configuration.typ, db.Configuration.settings)\n+    data = {name: yaml.load(settings) for name, settings in configs}\n+\n+    return data\n", "issue": "Model up yaml configs from the DB\nVarious yaml configs are stored in the database, including the one we'll most likely want to imspect, which is the vmdb config.\n\nThe schema, for our purposes, is two fields in the `configurations` table, `typ` and `settings`. The interface that I'm leaning toward is configurations[typ] = dictified_yaml(settings), if that makes sense. \n\nSo, for example, if we wanted to see whether or not to get a list of public images from ec2, the lookup would be `configurations['vmdb']['ems_refresh']['ec2']['get_public_images']`\n\n", "before_files": [{"content": "'''\n\n\nCreated on Jun 14, 2013\n\n@author: bcrochet\n\n'''\n# -*- coding: utf-8 -*-\n# pylint: disable=C0103\n# pylint: disable=E1101\nimport pytest\nfrom urlparse import urlparse\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nimport ConfigParser\n\ndef pytest_addoption(parser):\n    '''Create the options for py.test'''\n    config = ConfigParser.ConfigParser(defaults={\n        'cfmedburl': ''\n    })\n    config.read('cfme.cfg')\n\n    group = parser.getgroup('cfme', 'cfme')\n    group.addoption('--cfmedburl',\n                     action='store',\n                     dest='cfme_db_url',\n                     default=config.get('DEFAULT', 'cfmedburl'),\n                     metavar='url',\n                     help='url for CFME database to connect to')\n\ndef pytest_sessionstart(session):\n    '''Setup run for tests'''\n    import db\n    db.cfme_db_url = session.config.option.cfme_db_url\n    if not db.cfme_db_url:\n        # Let's try to figure it out\n        baseurl = session.config.option.base_url\n        baseip = urlparse(baseurl).hostname\n        db.cfme_db_url = \"postgres://root:smartvm@%s:5432/vmdb_production\" \\\n                % baseip\n    db.engine = create_engine(db.cfme_db_url)\n\n@pytest.fixture\ndef db_session():\n    '''Creates a database session based on the db url passed on the CLI\n\n    Usage example:\n\n    This is a SQLalchemy (http://www.sqlalchemy.org/) session. You can make\n    queries and create new rows in the database with this session.\n\n    The available classes are dynamically generated from the database. Consult\n    db/__init__.py for a list of available class -> table mappings.\n\n    An example test:\n\n    @pytest.mark.nondestructive\n    def test_that_tries_for_db(db_session):\n        import db\n        session = db_session\n        for instance in session.query(db.ExtManagementSystem).order_by(\n            db.ExtManagementSystem.id):\n        print instance.name, instance.hostname\n\n    This 'test' prints the management systems from the database.\n    '''\n    import db\n    Session = sessionmaker(bind=db.engine)\n    return Session()\n\n", "path": "fixtures/cfmedb.py"}], "after_files": [{"content": "'''\n\n\nCreated on Jun 14, 2013\n\n@author: bcrochet\n\n'''\n# -*- coding: utf-8 -*-\n# pylint: disable=C0103\n# pylint: disable=E1101\nimport pytest\nfrom urlparse import urlparse\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nimport ConfigParser\n\ndef pytest_addoption(parser):\n    '''Create the options for py.test'''\n    config = ConfigParser.ConfigParser(defaults={\n        'cfmedburl': ''\n    })\n    config.read('cfme.cfg')\n\n    group = parser.getgroup('cfme', 'cfme')\n    group.addoption('--cfmedburl',\n                     action='store',\n                     dest='cfme_db_url',\n                     default=config.get('DEFAULT', 'cfmedburl'),\n                     metavar='url',\n                     help='url for CFME database to connect to')\n\ndef pytest_sessionstart(session):\n    '''Setup run for tests'''\n    import db\n    db.cfme_db_url = session.config.option.cfme_db_url\n    if not db.cfme_db_url:\n        # Let's try to figure it out\n        baseurl = session.config.option.base_url\n        baseip = urlparse(baseurl).hostname\n        db.cfme_db_url = \"postgres://root:smartvm@%s:5432/vmdb_production\" \\\n                % baseip\n    db.engine = create_engine(db.cfme_db_url)\n\n@pytest.fixture\ndef db_session():\n    '''Creates a database session based on the db url passed on the CLI\n\n    Usage example:\n\n    This is a SQLalchemy (http://www.sqlalchemy.org/) session. You can make\n    queries and create new rows in the database with this session.\n\n    The available classes are dynamically generated from the database. Consult\n    db/__init__.py for a list of available class -> table mappings.\n\n    An example test:\n\n    @pytest.mark.nondestructive\n    def test_that_tries_for_db(db_session):\n        import db\n        session = db_session\n        for instance in session.query(db.ExtManagementSystem).order_by(\n            db.ExtManagementSystem.id):\n        print instance.name, instance.hostname\n\n    This 'test' prints the management systems from the database.\n    '''\n    import db\n    Session = sessionmaker(bind=db.engine)\n    return Session()\n\n@pytest.fixture\ndef db_yamls(db_session):\n    '''Returns the yamls from the db configuration table as a dict'''\n\n    import db\n    import yaml\n    configs = db_session.query(db.Configuration.typ, db.Configuration.settings)\n    data = {name: yaml.load(settings) for name, settings in configs}\n\n    return data\n", "path": "fixtures/cfmedb.py"}]}