diff options
-rw-r--r-- | lower-constraints.txt | 4 | ||||
-rw-r--r-- | releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml | 4 | ||||
-rw-r--r-- | saharaclient/api/v2/job_templates.py | 4 | ||||
-rw-r--r-- | saharaclient/api/v2/jobs.py | 6 | ||||
-rw-r--r-- | test-requirements.txt | 3 | ||||
-rw-r--r-- | tox.ini | 2 |
6 files changed, 12 insertions, 11 deletions
diff --git a/lower-constraints.txt b/lower-constraints.txt index eb1c9e8..090f387 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -34,7 +34,6 @@ netifaces==0.10.4 openstacksdk==0.11.2 os-client-config==1.28.0 os-service-types==1.2.0 -os-testr==1.0.0 osc-lib==1.8.0 oslo.config==5.2.0 oslo.context==2.19.2 @@ -64,14 +63,13 @@ python-subunit==1.0.0 pytz==2013.6 PyYAML==3.12 requests==2.14.2 -requests-mock==1.1.0 +requests-mock==1.2.0 requestsexceptions==1.2.0 rfc3986==0.3.1 simplejson==3.5.1 six==1.10.0 stestr==1.0.0 stevedore==1.20.0 -testrepository==0.0.18 testtools==2.2.0 traceback2==1.4.0 unittest2==1.1.0 diff --git a/releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml b/releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml new file mode 100644 index 0000000..76d89ca --- /dev/null +++ b/releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml @@ -0,0 +1,4 @@ +other: + - When using APIv2, the viewing (GET) of specific job templates and jobs and + the creation (POST) of job templates and jobs now only supports the API + behavior of Sahara 9.0.0.0b3 or later. diff --git a/saharaclient/api/v2/job_templates.py b/saharaclient/api/v2/job_templates.py index 0236829..3fb2be0 100644 --- a/saharaclient/api/v2/job_templates.py +++ b/saharaclient/api/v2/job_templates.py @@ -36,7 +36,7 @@ class JobTemplatesManagerV2(base.ResourceManager): libs=libs, interface=interface, is_public=is_public, is_protected=is_protected) - return self._create('/%s' % 'job-templates', data, 'job') + return self._create('/%s' % 'job-templates', data, 'job_template') def list(self, search_opts=None, limit=None, marker=None, sort_by=None, reverse=None): @@ -49,7 +49,7 @@ class JobTemplatesManagerV2(base.ResourceManager): def get(self, job_id): """Get information about a Job Template.""" - return self._get('/%s/%s' % ('job-templates', job_id), 'job') + return self._get('/%s/%s' % ('job-templates', job_id), 'job_template') def get_configs(self, job_type): """Get config hints for a specified Job Template type.""" diff --git a/saharaclient/api/v2/jobs.py b/saharaclient/api/v2/jobs.py index fa50894..15387a9 100644 --- a/saharaclient/api/v2/jobs.py +++ b/saharaclient/api/v2/jobs.py @@ -34,7 +34,7 @@ class JobsManagerV2(base.ResourceManager): def get(self, obj_id): """Get information about a Job.""" - return self._get('/jobs/%s' % obj_id, 'job_execution') + return self._get('/jobs/%s' % obj_id, 'job') def delete(self, obj_id): """Delete a Job.""" @@ -54,13 +54,13 @@ class JobsManagerV2(base.ResourceManager): job_configs=configs, interface=interface, is_public=is_public, is_protected=is_protected) - return self._create('/jobs', data, 'job_execution') + return self._create('/jobs', data, 'job') def refresh_status(self, obj_id): """Refresh Job Status.""" return self._get( '/jobs/%s?refresh_status=True' % obj_id, - 'job_execution' + 'job' ) def update(self, obj_id, is_public=NotUpdated, is_protected=NotUpdated): diff --git a/test-requirements.txt b/test-requirements.txt index 6dbca11..886ab37 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,5 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 -os-testr>=1.0.0 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD @@ -14,7 +14,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - ostestr {posargs} + stestr run {posargs} whitelist_externals = find rm passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY |