Implement job-types endpoint support methods for Fake plugin

This change implements the optional methods in the Plugins SPI
to support the job-types endpoint for the Fake plugin.

Partial-Implements: blueprint edp-job-types-endpoint
Change-Id: I114297bdc83a52d22e47e14f9a74f85e770524a1
This commit is contained in:
Trevor McKay 2015-03-18 13:22:44 -04:00
parent 456c559c7d
commit b1e2ede6e7

View File

@ -93,3 +93,14 @@ class FakePluginProvider(p.ProvisioningPluginBase):
def get_edp_engine(self, cluster, job_type): def get_edp_engine(self, cluster, job_type):
return edp_engine.FakeJobEngine() return edp_engine.FakeJobEngine()
def get_edp_job_types(self, versions=[]):
res = {}
for vers in self.get_versions():
if not versions or vers in versions:
res[vers] = edp_engine.FakeJobEngine.get_supported_job_types()
return res
def get_edp_config_hints(self, job_type, version):
if version in self.get_versions():
return edp_engine.FakeJobEngine.get_possible_job_config(job_type)