{"action":"created","comment":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/60153375","id":60153375,"diff_hunk":"@@ -891,117 +891,81 @@ class InvalidConfig(Exception):\n     \"\"\"\n \n \n-# Highly duplicative of other constants.  FLOC-2584.\n-class ProviderType(Names):\n-    \"\"\"\n-    Kinds of compute/storage cloud providers for which this module is able to\n-    build ``IBlockDeviceAPI`` providers.\n-    \"\"\"\n-    openstack = NamedConstant()\n-    aws = NamedConstant()\n-    gce = NamedConstant()\n-    rackspace = NamedConstant()\n+# XXX Remember to comment on or close FLOC-2584.\n \n \n-def get_blockdeviceapi(provider_type):\n+def get_blockdeviceapi():\n     \"\"\"\n     Validate and load cloud provider's yml config file.\n     Default to ``~/acceptance.yml`` in the current user home directory, since\n     that's where buildbot puts its acceptance test credentials file.\n     \"\"\"\n-    config = get_blockdevice_config(provider_type)\n-    provider = _provider_for_provider_type(provider_type)\n+    config = get_blockdevice_config()\n+    backend_name = config.pop('backend')\n+    provider = Providers.lookupByName(backend_name.upper())\n     factory = _BLOCKDEVICE_TYPES[provider]\n     return factory(make_cluster_id(TestTypes.FUNCTIONAL, provider), config)\n \n \n-def _provider_for_provider_type(provider_type):\n-    \"\"\"\n-    Convert from ``ProviderType`` values to ``Providers`` values.\n-    \"\"\"\n-    if provider_type in (ProviderType.openstack, ProviderType.rackspace):\n-        return Providers.OPENSTACK\n-    if provider_type is ProviderType.aws:\n-        return Providers.AWS\n-    if provider_type is ProviderType.gce:\n-        return Providers.GCE\n-    return Providers.UNSPECIFIED\n-\n-\n-def get_blockdevice_config(provider_type):\n+def get_blockdevice_config():\n     \"\"\"\n     Get configuration dictionary suitable for use in the instantiation\n-    of an ``IBlockDeviceAPI`` implementation compatible with the given\n-    provider type.\n-\n-    :param provider_type: A provider type the ``IBlockDeviceAPI`` is to\n-        be compatible with.  A value from ``ProviderType``.\n+    of an ``IBlockDeviceAPI`` implementation.\n \n     :raises: ``InvalidConfig`` if a\n         ``FLOCKER_FUNCTIONAL_TEST_CLOUD_CONFIG_FILE`` was not set and the\n         default config file could not be read.\n \n-    :return: A two-tuple of an ``IBlockDeviceAPI`` implementation and a\n-        ``dict`` of keyword arguments that can be used instantiate that\n-        implementation.\n+    :return: XXX\n     \"\"\"\n-    # ie cust0, rackspace, aws\n-    platform_name = environ.get('FLOCKER_FUNCTIONAL_TEST_CLOUD_PROVIDER')\n-    if platform_name is None:\n-        raise InvalidConfig(\n-            'Supply the platform on which you are running tests using the '\n-            'FLOCKER_FUNCTIONAL_TEST_CLOUD_PROVIDER environment variable.'\n+    flocker_functional_test = environ.get('FLOCKER_FUNCTIONAL_TEST')\n+    if flocker_functional_test is None:\n+        raise SkipTest(\n+            'Please set FLOCKER_FUNCTIONAL_TEST environment variable to '\n+            'run storage backend functional tests.'\n         )\n \n     config_file_path = environ.get('FLOCKER_FUNCTIONAL_TEST_CLOUD_CONFIG_FILE')\n     if config_file_path is None:\n-        raise InvalidConfig(\n-            'Supply the path to a cloud credentials file '\n+        raise SkipTest(\n+            'Supply the path to a backend configuration file '\n             'using the FLOCKER_FUNCTIONAL_TEST_CLOUD_CONFIG_FILE environment '\n-            'variable. See: '\n-            'https://docs.clusterhq.com/en/latest/gettinginvolved/acceptance-testing.html '  # noqa\n-            'for details of the expected format.'\n+            'variable.'\n+        )\n+\n+    # ie storage-drivers.rackspace\n+    config_section = environ.get(\n+        'FLOCKER_FUNCTIONAL_TEST_CLOUD_CONFIG_SECTION',\n+    )\n+    if config_section is None:\n+        raise SkipTest(\n+            'Supply the section of the config file '\n+            'containing the configuration for the driver under test '\n+            'with the FLOCKER_FUNCTIONAL_TEST_CLOUD_CONFIG_SECTION '\n+            'environment variable.'\n         )\n \n     with open(config_file_path) as config_file:\n         config = yaml.safe_load(config_file.read())\n \n-    section = config.get(platform_name)\n-    if section is None:\n-        raise InvalidConfig(\n-            \"The requested cloud platform \"\n-            \"was not found in the configuration file. \"\n-            \"Platform: %s, \"\n-            \"Configuration File: %s\" % (platform_name, config_file_path)\n-        )\n-\n-    provider_name = section.get('provider', platform_name)\n-    try:\n-        provider_environment = ProviderType.lookupByName(provider_name)\n-    except ValueError:\n-        raise InvalidConfig(\n-            \"Unsupported provider. \"\n-            \"Supplied provider: %s, \"\n-            \"Available providers: %s\" % (\n-                provider_name,\n-                ', '.join(p.name for p in ProviderType.iterconstants())\n-            )\n-        )\n+    section = None\n+    for section in config_section.split('.'):\n+        config = config.get(section)\n \n-    if provider_environment != provider_type:\n+    if config is None:\n         raise InvalidConfig(\n-            \"The requested cloud provider (%s) is not the provider running \"\n-            \"the tests (%s).\" % (provider_type.name, provider_environment.name)\n+            \"The requested section \"\n+            \"was not found in the configuration file. \"\n+            \"Section: %s, \"\n+            \"Configuration File: %s\" % (config_section, config_file_path)\n         )\n \n-    # XXX - If provider type is Rackspace, we add the auth_plugin config\n-    # here.  The CI system should be configured to provide this\n-    # parameter as part of the config, to match the documented way of\n-    # configuring Rackspace.\n-    if provider_environment == ProviderType.rackspace:\n-        section['auth_plugin'] = 'rackspace'\n+    # XXX A hack to work around the fact that the sub-sections of","path":"flocker/node/agents/testtools/_blockdevice.py","position":175,"original_position":168,"commit_id":"802c879d92b378927c7ea22400270ed042efdce5","original_commit_id":"bb3820cd72c84ccbd981d8c982a9bb3cff251741","user":{"login":"wallrj","id":978965,"avatar_url":"https://avatars.githubusercontent.com/u/978965?v=3","gravatar_id":"","url":"https://api.github.com/users/wallrj","html_url":"https://github.com/wallrj","followers_url":"https://api.github.com/users/wallrj/followers","following_url":"https://api.github.com/users/wallrj/following{/other_user}","gists_url":"https://api.github.com/users/wallrj/gists{/gist_id}","starred_url":"https://api.github.com/users/wallrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallrj/subscriptions","organizations_url":"https://api.github.com/users/wallrj/orgs","repos_url":"https://api.github.com/users/wallrj/repos","events_url":"https://api.github.com/users/wallrj/events{/privacy}","received_events_url":"https://api.github.com/users/wallrj/received_events","type":"User","site_admin":false},"body":"@sarum90 I'll leave it in this branch and we can discuss removing it as soon as I land the segredos fix.","created_at":"2016-04-18T23:41:33Z","updated_at":"2016-04-18T23:41:33Z","html_url":"https://github.com/ClusterHQ/flocker/pull/2762#discussion_r60153375","pull_request_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762","_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/60153375"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2762#discussion_r60153375"},"pull_request":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762"}}},"pull_request":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762","id":66544734,"html_url":"https://github.com/ClusterHQ/flocker/pull/2762","diff_url":"https://github.com/ClusterHQ/flocker/pull/2762.diff","patch_url":"https://github.com/ClusterHQ/flocker/pull/2762.patch","issue_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2762","number":2762,"state":"open","locked":false,"title":"Review Branch (DO NOT MERGE)","user":{"login":"sarum90","id":604129,"avatar_url":"https://avatars.githubusercontent.com/u/604129?v=3","gravatar_id":"","url":"https://api.github.com/users/sarum90","html_url":"https://github.com/sarum90","followers_url":"https://api.github.com/users/sarum90/followers","following_url":"https://api.github.com/users/sarum90/following{/other_user}","gists_url":"https://api.github.com/users/sarum90/gists{/gist_id}","starred_url":"https://api.github.com/users/sarum90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarum90/subscriptions","organizations_url":"https://api.github.com/users/sarum90/orgs","repos_url":"https://api.github.com/users/sarum90/repos","events_url":"https://api.github.com/users/sarum90/events{/privacy}","received_events_url":"https://api.github.com/users/sarum90/received_events","type":"User","site_admin":false},"body":"This reviews https://github.com/ClusterHQ/flocker/pull/2758  (against it's logical head)","created_at":"2016-04-14T20:02:11Z","updated_at":"2016-04-18T23:41:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"773e49290e24db42d0df5402713e2bbdee948ea2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762/commits","review_comments_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762/comments","review_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2762/comments","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/802c879d92b378927c7ea22400270ed042efdce5","head":{"label":"ClusterHQ:usable-api-factory-for-tests-FLOC-4374","ref":"usable-api-factory-for-tests-FLOC-4374","sha":"802c879d92b378927c7ea22400270ed042efdce5","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterHQ/flocker/deployments","created_at":"2014-04-28T18:02:14Z","updated_at":"2016-04-18T17:10:33Z","pushed_at":"2016-04-18T11:05:01Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":59597,"stargazers_count":2257,"watchers_count":2257,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":43,"forks":170,"open_issues":43,"watchers":2257,"default_branch":"master"}},"base":{"label":"ClusterHQ:blockdevicefactory-to-testtools-FLOC-1840","ref":"blockdevicefactory-to-testtools-FLOC-1840","sha":"500fe4c85f7f117e3a0d0e33d6d47fe630d687f3","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterHQ/flocker/deployments","created_at":"2014-04-28T18:02:14Z","updated_at":"2016-04-18T17:10:33Z","pushed_at":"2016-04-18T11:05:01Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":59597,"stargazers_count":2257,"watchers_count":2257,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":43,"forks":170,"open_issues":43,"watchers":2257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2762"},"issue":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2762"},"comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2762/comments"},"review_comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762/comments"},"review_comment":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2762/commits"},"statuses":{"href":"https://api.github.com/repos/ClusterHQ/flocker/statuses/802c879d92b378927c7ea22400270ed042efdce5"}}}}