Change MAAS api endpoints according to v3.0.0

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I9daa8b5b8d76f2da939ce0dffdb3471ba7cd8947
This commit is contained in:
Ruslan Aliev 2023-03-05 04:19:38 -06:00
parent b431f7a2cf
commit 389db640e4
5 changed files with 18 additions and 19 deletions

View File

@ -51,7 +51,7 @@ coverage_test: build_drydock
# Run just unit tests # Run just unit tests
unit_tests: external_dep unit_tests: external_dep
tox -re py35 $(TESTS) tox -re py36 $(TESTS)
# Run just DB integration tests # Run just DB integration tests
db_integration_tests: external_dep db_integration_tests: external_dep

View File

@ -18,7 +18,7 @@ import drydock_provisioner.drivers.node.maasdriver.models.base as model_base
class IpRange(model_base.ResourceBase): class IpRange(model_base.ResourceBase):
resource_url = 'iprange/{resource_id}/' resource_url = 'ipranges/{resource_id}/'
fields = ['resource_id', 'comment', 'subnet', 'type', 'start_ip', 'end_ip'] fields = ['resource_id', 'comment', 'subnet', 'type', 'start_ip', 'end_ip']
json_fields = ['comment', 'start_ip', 'end_ip'] json_fields = ['comment', 'start_ip', 'end_ip']

View File

@ -376,7 +376,7 @@ class Machine(model_base.ResourceBase):
url = self.interpolate_url() url = self.interpolate_url()
resp = self.api_client.post( resp = self.api_client.post(
url, op='set_owner_data', files={key: value}) url, op='set_workload_annotations', files={key: value})
if resp.status_code != 200: if resp.status_code != 200:
self.logger.error( self.logger.error(

View File

@ -20,7 +20,7 @@ import drydock_provisioner.drivers.node.maasdriver.models.base as model_base
class NodeResult(model_base.ResourceBase): class NodeResult(model_base.ResourceBase):
resource_url = 'commissioning-results/' resource_url = 'installation-results/'
fields = [ fields = [
'resource_id', 'name', 'result_type', 'updated', 'data', 'resource_id', 'name', 'result_type', 'updated', 'data',
'script_result' 'script_result'

29
tox.ini
View File

@ -1,22 +1,22 @@
[tox] [tox]
envlist = py35,pep8,bandit envlist = py36,pep8,bandit
setupdir=python/ setupdir=python/
[testenv] [testenv]
setenv = YAMLDIR = {toxinidir}/python/tests/yaml_samples/ setenv = YAMLDIR = {toxinidir}/python/tests/yaml_samples/
basepython=python3 passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
deps= deps=
-rpython/requirements-lock.txt -r{toxinidir}/python/requirements-lock.txt
-rpython/requirements-test.txt -r{toxinidir}/python/requirements-test.txt
[testenv:venv] [testenv:venv]
basepython=python3
commands = {posargs} commands = {posargs}
[testenv:freeze] [testenv:freeze]
basepython=python3 basepython=python3
recreate = True recreate = True
whitelist_externals= allowlist_externals=
rm rm
sh sh
deps= deps=
@ -27,7 +27,7 @@ commands=
[testenv:yapf] [testenv:yapf]
basepython=python3 basepython=python3
whitelist_externals=find allowlist_externals=find
commands= commands=
yapf -i -r --style=pep8 {toxinidir}/python/setup.py yapf -i -r --style=pep8 {toxinidir}/python/setup.py
yapf -i -r --style=pep8 {toxinidir}/alembic yapf -i -r --style=pep8 {toxinidir}/alembic
@ -35,8 +35,7 @@ commands=
yapf -i -r --style=pep8 {toxinidir}/python/tests yapf -i -r --style=pep8 {toxinidir}/python/tests
find {toxinidir}/python/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ; find {toxinidir}/python/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ;
[testenv:py35] [testenv:py36]
basepython=python3
usedevelop=True usedevelop=True
setenv= setenv=
PYTHONWARNING=all PYTHONWARNING=all
@ -47,8 +46,8 @@ commands=
{toxinidir}/python/tests/unit/{posargs} {toxinidir}/python/tests/unit/{posargs}
[testenv:integration] [testenv:integration]
basepython=python3.5 basepython=python3
passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG passenv=DOCKER_REGISTRY,IMAGE_NAME,IMAGE_PREFIX,IMAGE_TAG
setenv= setenv=
PYTHONWARNING=all PYTHONWARNING=all
YAMLDIR={toxinidir}/python/tests/yaml_samples/ YAMLDIR={toxinidir}/python/tests/yaml_samples/
@ -60,7 +59,7 @@ commands=
[testenv:cover] [testenv:cover]
basepython=python3 basepython=python3
usedevelop=True usedevelop=True
passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG passenv=DOCKER_REGISTRY,IMAGE_NAME,IMAGE_PREFIX,IMAGE_TAG
setenv= setenv=
YAMLDIR={toxinidir}/python/tests/yaml_samples/ YAMLDIR={toxinidir}/python/tests/yaml_samples/
commands= commands=
@ -70,13 +69,13 @@ commands=
[testenv:genconfig] [testenv:genconfig]
basepython=python3 basepython=python3
whitelist_externals=tee allowlist_externals=tee
sh sh
commands = sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample doc/source/_static/drydock.conf.sample' commands = sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample doc/source/_static/drydock.conf.sample'
[testenv:genpolicy] [testenv:genpolicy]
basepython=python3 basepython=python3
whitelist_externals=tee allowlist_externals=tee
sh sh
commands = sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample doc/source/_static/policy.yaml.sample' commands = sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample doc/source/_static/policy.yaml.sample'
@ -98,7 +97,7 @@ max-line-length=119
basepython=python3 basepython=python3
deps= deps=
-rdoc/requirements-doc.txt -rdoc/requirements-doc.txt
whitelist_externals=rm allowlist_externals=rm
recreate=true recreate=true
commands = commands =
rm -rf doc/build rm -rf doc/build